Posted by
Peter <Nabble> on
Oct 22, 2011; 6:40pm
URL: https://support.nabble.com/Duplicate-title-tags-and-meta-descriptions-tp6759630p6920681.html
Kind of. Take a look at this one for instance. I will explain to you what is being done here:
<n.if.is_root>
<---- 1 <then>
NY Ski Forum | Trip Reports, Ski Conditions, Snow Sports | Harvey Road
</then>
<else>
<n.if.is_post>
<---- 2 <then>
<n.subject/> | NY Ski Forum
<----- 3 </then>
<else>
<----- 4 NY Ski Forum | <n.subject/> | Harvey Road
<--- 5 </else>
</n.if.is_post>
</else>
</n.if.is_root>
1 - we are checking to see if that particular page is a root node. This means the root of your site, your main page. If it is the root, the "then" will be executed, the "else" won't. The "then" returns the title of your main page.
Now we are left with 2 situations to check on the else. We need to know if a subforum is being displayed or if a post is being displayed.
2- we are checking if that is a post. If it is a post, we need to show the subject of the post with " | NY Ski Forum" at the end. That's what we do on 3.
3- the <n.subject> shows the subject of the node on that page. Since we know this code only runs on post's pages (because of the <if><then>, then it is the post's subject.
4- We have already checked if it is the root on 1 and we are in it's "<else>" so it is not the root. We have also checked inside this else if we are on a post page and we know it's not because we are on it's <else>" too. So that leaves us with the subforum page. So that displays the title of your subforum pages -> all of them.
All subforum pages are running that code. and then we get to 5.
5- Displays a title in a similar way we do on 3. The only difference is that we add something to the beginning of the subject and something at the end of it instead of only the end.
What Hugo proposed will work very well but you would have to change it whenever you add a subforum to add a new n.case.
The way you were going was to change what we did that will work for every page dinamically.
Nabble staff. We never ask for passwords.