Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Aaron10 on December 06, 2019, 04:57:34 PM

Title: Help setting perimeters in the <title>
Post by: Aaron10 on December 06, 2019, 04:57:34 PM
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:

Code: [Select]
<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:

Code: [Select]
<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
Title: Re: Help setting perimeters in the <title>
Post by: Kindred on December 06, 2019, 05:11:49 PM
did you try using the Optimus Brave mod?
Title: Re: Help setting perimeters in the <title>
Post by: Aaron10 on December 06, 2019, 05:17:03 PM
Hadn't heard of it until now, does it work with 2.1 however?
Title: Re: Help setting perimeters in the <title>
Post by: Kindred on December 06, 2019, 06:04:46 PM
dunno... you can try.