Advertisement:

Author Topic: Help setting perimeters in the <title>  (Read 446 times)

Offline Aaron10

  • Full Member
  • ***
  • Posts: 528
  • Gender: Male
Help setting perimeters in the <title>
« 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

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 59,296
  • Gender: Male
    • Kindred-999 on GitHub
Re: Help setting perimeters in the <title>
« Reply #1 on: December 06, 2019, 05:11:49 PM »
did you try using the Optimus Brave mod?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Aaron10

  • Full Member
  • ***
  • Posts: 528
  • Gender: Male
Re: Help setting perimeters in the <title>
« Reply #2 on: December 06, 2019, 05:17:03 PM »
Hadn't heard of it until now, does it work with 2.1 however?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 59,296
  • Gender: Male
    • Kindred-999 on GitHub
Re: Help setting perimeters in the <title>
« Reply #3 on: December 06, 2019, 06:04:46 PM »
dunno... you can try.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.