page title in the head tag

Oliver Acev asked on January 17, 2021 09:04

I have documents tree like this

products - product1 - product2 - product3 etc

When i click on product3 in the browsers showing head title

product3 - website name

Can someone help me?

I want to show all path of the documents

product3 - product2 - product1 - website name

Recent Answers


David te Kloese answered on January 18, 2021 08:44 (last edited on January 18, 2021 08:45)

Hi,

Not sure if it's SEO wise a good plan to list your complete parent tree items in the title! As it's also used in for instance Google. Also you might hit a browser limit at some point.


The Page title is configured in the Settings module. Under Settings -> Content.

You probably have something like {%pagetitle_orelse_name%} - {%prefix%}

Although you could possibly create a macro loop in there, if you really want to get all levels I'd say create a custom macro method that would move all logic to code. Also you could make sure to add caching and perhaps add other requirements like not listing certain page types, skipping 'folders', apply a max length, etc.

https://docs.xperience.io/.../registering-custom-macro-methods

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 21, 2021 18:07

Assuming you're using portal engine for development and not MVC, you can use a macro in the page's metadata that will override the base setup from the site. Here's an example of a page's description metadata is being set dynamically based on the page type and field names.

{% if(CurrentDocument.ClassName == "cms.blogpost"){BlogPostSummary}else{"Kentico MVP Brenden Kehren talks about Kentico how tos, provides code samples and education and just life in general."} #%}

This is what we did for portal engine configurations. It allowed the metadata to be very dynamic in nature and not require the content editors to be SEO experts but allowed them to get some very awesome SEO scores because of the content that was put in place.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.