Tokens
Register custom token normalizers for additional fieldtypes or add custom value tokens to the token input.
Token Normalizers
Creating a Normalizer
namespace App\Seo\Tokens;
use Aerni\AdvancedSeo\Tokens\TokenNormalizer;
use Statamic\Fields\Value;
class TagsTokenNormalizer extends TokenNormalizer
{
public function fieldtype(): string
{
return 'tags';
}
public function normalize(Value $value): ?string
{
return collect($value->value())->join(', ');
}
}API
Method
Description
Value Tokens
Creating a Value Token
API
Method
Description
Registration
Via Config
Via Service Provider
Last updated