logo
Documents |

SEO settings for Extension

Table of Content

This article assumes that you already understand the concept of Extension.

SEO for Extension

When an Extension is created and not marked private, a frontend Page will be created for it.

You can manage the SEO settings of this generated page just like any other page.

Utilize the current item

In most cases, you will want to print out the SEO metas corresponding to the current item being accessed (for example, you may want to print out the name of the current item as the page's title).


You can put the following twig code inside the page's title field:

{{ context.resource.name }}


To have better control of the title, we normally create an additional field named seoTitle for the extension and print it out like this:

{{ context.resource.seoTitle }}


What if we forget to put in the seoTitle for the item? We don't want to leave the title empty, we can do something like this:

{{ context.resource.seoTitle | default(context.resource.name) }}

The code above basically checks if the seoTitle is empty then fall back to the name field.


What if we want to capitalize all the text for the title? That's easy with twig:

{{ context.resource.seoTitle | default(context.resource.name) | capitalize }}

seo-for-extension

NOTE In most cases, we will pre-create the 'seoTitle', 'seoKeywords', 'seoDescription' and configure everything for you by default for your convenience. Contact our support if you need help.

Share

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.