Help setting perimeters in the <title>

Started by Aaron10, December 06, 2019, 04:57:34 PM

Previous topic - Next topic

Aaron10

Hi, I'm trying to achieve the following inside the <title> tags:

Site Name - Current Board Name - Current Topic Title

From what I've seen there's two ways to achieve this, firstly:

<title>',  $context['forum_name'], empty($context['linktree'][2]['name'])?'':' - '.$context['linktree'][2]['name'], empty($context['linktree'][3]['name'])?'':' - '.$context['linktree'][3]['name'], empty($context['linktree'][4]['name'])?'':' - '.$context['linktree'][4]['name'],'</title>

While this does indeed work, it captures all parent/child board names, for example:

mysite.com - Parent Board - Child Board - Current Topic Title

instead of

mysite.com - Child Board - Current Topic Title

The other method is something like this but of course it pulls the IDs instead:

<title>',  $context['forum_name'], empty($context['current_board'])?'':' - '.$context['current_board'], empty($context['current_topic'])?'':' - '.$context['current_topic'] ,'</title>

resulting in:

mysite.com - 1 - 123

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Aaron10

Hadn't heard of it until now, does it work with 2.1 however?

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: