When you create an Extension in Nilead and it’s not marked private, a public-facing page is automatically generated for it. You can customize the SEO settings (such as title, description, and keywords) for each of these pages using dynamic Twig code, giving you full control and fallback logic for better SEO.
You have already created an Extension in Nilead
The Extension is not marked private
Basic familiarity with Twig templating
Optional: Access to add custom fields like seoTitle, seoDescription, etc.
Each Extension item (resource) rendered on the frontend has a dynamic context:
Use context.resource to access its data.
By default, you might want to use the Extension item's name as the page title:
{{ context.resource.name }}But for better SEO control, it's common to define a dedicated field called seoTitle. You can reference it like this:
{{ context.resource.seoTitle }}If an item doesn’t have a seoTitle value, you can safely fall back to the item’s name:
{{ context.resource.seoTitle | default(context.resource.name) }}This ensures your page always has a title, even if seoTitle is missing.
Need to capitalize the title text for stylistic or branding reasons? You can chain Twig filters:
{{ context.resource.seoTitle | default(context.resource.name) | capitalize }}This capitalizes the first letter of the output string.
If available, you can apply the same logic to other fields:
<meta name="description" content="{{ context.resource.seoDescription | default('Default description') }}">
<meta name="keywords" content="{{ context.resource.seoKeywords }}">
Nilead typically pre-defines fields like seoTitle, seoDescription, and seoKeywords for convenience. If you’re missing them or want to customize further, reach out to Nilead support.
1. What happens if my Extension is marked private?
A frontend page will not be generated, and SEO settings will not apply.
2. Do I have to define seoTitle manually for every item?
No. You can use Twig’s default filter to fall back to another field like name.
3. Can I use Twig filters like upper or replace in SEO fields?
Yes. Twig filters work as expected inside SEO fields in Nilead.
4. Can I apply the same method to blogs or other content types?
Yes. The same Twig logic can be used across any content type that renders dynamic context.