Document SEO settings for Extension

SEO settings for Extension

Customize SEO titles and descriptions for Extensions using Twig and dynamic values in Nilead.

Table of content

TL;DR / Overview

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.

Prerequisites

  • 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.

Walkthrough

Step 1: Understand the Context

Each Extension item (resource) rendered on the frontend has a dynamic context:
Use context.resource to access its data.

Step 2: Add Dynamic SEO Title

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 }}

Step 3: Add a Fallback Value

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.

Step 4: Modify Output (Optional)

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.

Step 5: Use Other SEO Fields

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 }}">

Default Setup

seo-for-extension

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.


FAQs

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.

Discord chat

We're available Monday–Friday, security and critical bug fixes are available 24/7.

Facebook page

Get the latest news and updates regarding Nilead platform and services.