Ignore Page Name on the Homepage Page Title

kumar GANJI asked on January 19, 2023 13:41

I am setting up the page titles in my Kentico site. I was able to find the location to control the title structure across all pages but I do not want the homepage to follow that structure.

I tried following ways: * {% if(DocumentContext.CurrentDocument.NodeAliasPath != "/home"){ pagetitle_orelse_name + " | "} @%}{%prefix%} *
* {% if(CurrentDocument.NodeAlias.ToLower() != "home") {pagetitle_orelse_name +" | "} #%}{%prefix%}

But they are not working any suggestion?

Correct Answer

Arjan van Hugten answered on January 19, 2023 16:08

You can get the current document node alias path by using "NodeAliasPath" directly in the macro. So it should be something like this:

{% NodeAliasPath != "/home" ? pagetitle_orelse_name + " | " + prefix : "" %}

0 votesVote for this answer Unmark Correct answer

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