News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Change Page Titles on Board Pages

Started by bjraines, May 11, 2009, 12:05:33 PM

Previous topic - Next topic

bjraines

I would like to have a custom title on board pages

Is there a bit of code I can add that will allow me to affect this?

JBlaze

index.template.php
Code (find) Select
<title>', $context['page_title'], '</title>';
Code (replace) Select
<title>', $txt['custom_page_title'], '</title>';

Modifications.english.php
Code (find at end of file) Select
?>
Code (add before) Select
$txt['custom_page_title'] = 'My Custom Page Title';
Edit 'My Custom Title' to what you want it to say
Jason Clemons
Former Team Member 2009 - 2012

bjraines

yes but how can I target the board pages

so say ,

if index.php  use this page title

if board page 1 , use this page title


JBlaze

What kind of title would you want it to be?

There are some $context variables that you can use to display a different title. Just give me a hint as to what you would like for a title and I'll see what I can dig up :)
Jason Clemons
Former Team Member 2009 - 2012

bjraines

I need the index.php to be  Free Chemistry Homework Help | Site Name

I need the Board Pages to be

Board Name | Free Chemistry Homework Help | Site Name

I need message pages to be

Original Post Title | Free Chemistry Homework Help | Site Name

and then everythign else to behave as normal.

JBlaze

Jason Clemons
Former Team Member 2009 - 2012

bjraines

I use something like this now

if(empty($context['current_action']) && !is_array($context['moderators'])) {
echo '   <title> Free Chemistry Help | High School, College & AP Chemistry | My Chemistry Tutor</title>';
}
else
{
echo '   <title>', $context['page_title'],' | Free Chemistry Help </title>';
}

however I want to extend it a bit to be more specific  to separate the logic between the boards and the posts.

HplyEvrAftr

Sorry to hijack your thread,but i hated to start a new one, as i think it's a similar question.

I am installing a few new themes on our 1.1.8 forum....  Is there a way to change the theme title to our site name -- IE:  SMFv2  to our site name -- or add a banner perhaps??  If you guys want me to make a sep thread, that is fine too.....  just figured I'd ask here first!!

Thanks in advance  8)

H

Quote from: HplyEvrAftr on May 11, 2009, 06:02:13 PM
Sorry to hijack your thread,but i hated to start a new one, as i think it's a similar question.

I am installing a few new themes on our 1.1.8 forum....  Is there a way to change the theme title to our site name -- IE:  SMFv2  to our site name -- or add a banner perhaps??  If you guys want me to make a sep thread, that is fine too.....  just figured I'd ask here first!!

Thanks in advance  8)

A separate topic would probably be better for this :)

Quotehowever I want to extend it a bit to be more specific  to separate the logic between the boards and the posts.

bjraines, do you need any further advice on this? :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Advertisement: