View Full Version : How to change the title of thread page individually and/or Globally ?
cbishwaraj
12-01-2010, 06:45 PM
Hi,
We are running Publishing Suite 4.0 and VBSEO 3.5.2.
Q. How to change the 'title' of the Thread pages of the Forum? Now, its appearing exactly as thread Name. But we are thinking to change it with our own SEO keywords.
Can we individually/Globally control it ? ( Adding some words as suffix or Prefix to all the threads in Forums) ?
Thank you for your support.
cbishwaraj.:confused:
BirdOPrey5
12-02-2010, 04:06 AM
If you edit your SHOWTHREAD template... find the line:
<title>{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
You can add words immediately after <title> or immediately before </title> to add words to your title (either before or after the auto created title.)
Example
<title>Thread View - {vb:raw thread.prefix_plain_html} {vb:raw thread.title} More Keywords Here</title>
cbishwaraj
12-02-2010, 12:40 PM
Hi BirdOPreys,
Thank you so much for your help. this is what I need but i didn't find that line of code.
It is in the 'showthread.php' file in root folder ?
I am using Publishing Suite 4.0.....If you could please tell me again would be great!
Thank you for your support.
Cbishwaraj.
BirdOPrey5
12-02-2010, 12:46 PM
It's in your SHOWTHREAD template, not the php file.
To edit a template open your Admin CP
On the menu go to "Styles & Templates" and choose "Style Manager"
Choose your style (repeat for each one if you have more than one active style)
Choose "Edit Templates"
Scroll down to "SHOWTHREAD" template (it's in the "Show Thread Templates" group)
Double click on the SHOWTHREAD template and it will open in the editor...
Make the changes I mentioned and save the template... then go ahead and test it and make sure it's working as expected.
cbishwaraj
12-02-2010, 01:52 PM
BirdOprey5,
Thanks so much!!!! I got it and its done!!!!!
Another concern with this : We have nearly 200 differnet forums in same site(Publishing suite). Is there any way we can have seperate titles (adding as suffix: in the same way) for all the seperate Forums threads ?
( Meaning: We need add keywords differently as per related topic of the FORUMS)
I hope you understand this question.
This is just a question, if this is possible feature in Publishing suite ?
Thank you so much again.
cbishwaraj.
BirdOPrey5
12-02-2010, 07:07 PM
It is possible but it will mean A LOT of code writing to make it for each forum.
You can use template conditionals to make the changes only to specific forums.
More info on template conditionals here: https://vborg.vbsupport.ru/showthread.php?t=231525
You'd need to write an "IF" Statement for every forum you want to have a custom title for.
Something like:
<vb:if condition="$forum[forumid] == 2">
<title>Custom Title for Threads in Forum 2{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
<vb:elseif condition="$forum[forumid] == 3" />
<title>Custom Title for Threads in Forum 3{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
<vb:elseif condition="$forum[forumid] == 4" />
<title>Custom Title for Threads in Forum 4{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
<vb:elseif condition="$forum[forumid] == 5" />
<title>Custom Title for Threads in Forum 5{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
<vb:else />
<title>Custom Title for Threads any forum not mentioned above {vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
</vb:if>
Make sure it starts if "if" ends with "else" and all the ones in-between are "elseif"
cbishwaraj
12-03-2010, 03:38 PM
BirdOPrey5,
Great Answer! I appreciate this and Thank you so much.
Now, I have a concern again : Am I adding this kind of code in SHOWTHREAD template only? or do I need to paste it in different pages( or different code) ?
and how can I define each of the forums with ids ? Is there anything in adminCP to define Forums by id ?
I have knowledge working with if-Else so I am comfortable in your ideas/suggestions.
Thank you so much for helping me.
cbishwaraj
BirdOPrey5
12-03-2010, 07:11 PM
The title of the pages is only in SHOWTHREAD so that's the only code you need to change.
In Admin CP go to Forum Manager, click on any forum and at the top of the settings page should be the Forum ID number for that forum.
cbishwaraj
12-06-2010, 05:45 PM
Great BirdOPrey5!
Thank you so much for your help and support.
cbishwaraj
--------------- Added 1291737232 at 1291737232 ---------------
Hi BirdOPrey5,
I was testing the title of the threads for couple of the forums with the following code but
all the title prefixs are appearing with :
Custom Title for Threads any forum not mentioned above +Title added in thread
At least i was supposed to get the differernt title to Forums that are with ID 114 and 115.
Could you please take a look to following code and let me know where is wrong.
Please suggest me.
Thank you.
************************************************** ***********************
.....................................
....................................
<head>
{vb:raw headinclude}
<vb:if condition="$threadinfo['keywords']"><meta name="keywords" content="{vb:raw threadinfo.keywords}" /></vb:if>
<meta name="description" content="{vb:raw thread.meta_description}" />
<--- I added here -->
<vb:if condition="$forum[forumid] == 114">
<title>Aarons | 114{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
<vb:elseif condition="$forum[forumid] == 115" />
<title>Abt Electronics | 115{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
<vb:else />
<title>Custom Title for Threads any forum not mentioned above {vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
</vb:if>
<----I ended here (just testing 2 forums --->
<link rel="canonical" href="{vb:raw thread_url}" />
<vb:if condition="$show['reputation']">
<script type="text/javascript" src="clientscript/vbulletin-ajax-reputation.js?v={vb:raw vboptions.simpleversion}"></script>
</vb:if>
<script type="text/javascript" src="clientscript/vbulletin_textedit.js?v={vb:raw vboptions.simpleversion}"></script>
.................................................. ..................................................
.......................................
************************************************** ***********************
cbishwaraj
12-09-2010, 02:16 PM
Hi BirdOPrey5,
Could you please suggest me by looking into my code. I was trying to implement new titles only for two forums-threads.
where did i wrong ?
Your help on this would be great.
Thanks
cbishwaraj
Brandon Sheley
12-09-2010, 03:06 PM
why not just edit the thread title itself?
seems like a lot of work to do something so simple...
BirdOPrey5
12-09-2010, 03:07 PM
Hey, i'm sorry, I messed up... it'd not $forum[forumid] it's $thread[forumid] when using the conditionals in SHOWTHREAD. $forum is when in FORUMDISPLAY template.
This code works, I just tested it:
<vb:if condition="$thread[forumid] == 114">
<title>Aarons | 114{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
<vb:elseif condition="$thread[forumid] == 115" />
<title>Abt Electronics | 115{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
<vb:else />
<title>{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
</vb:if>
--------------- Added 1291914493 at 1291914493 ---------------
why not just edit the thread title itself?
seems like a lot of work to do something so simple...
How else would you edit the title in specific forums only? :confused:
cbishwaraj
12-15-2010, 03:20 PM
Hi BirdOPrey5,
Is there any limitation for number of If-Else Command for Show Thread template?
I have nearly 300 Forums and theirs respective threads.
I was adding title prefix with the same If-Else command strategy.
I was being able to change the title upto 100 of Forums.
But after that Thread title are not changed and Following error message is coming to V Bulletin Admin Panel while saving the code:
*****************
Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3391
The following error occurred when attempting to evaluate this template:
%1$s
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
******************
Could you PLEASE Help me on this ?
Thank you so much for your support.
Cbishwaraj.
BirdOPrey5
12-15-2010, 04:14 PM
I'm not aware of any limits, more than likely there's an extra or missing quotation mark (") or equals sign =... If you can paste in the code you have I can take a look at it and see if I see anything.
Use the BB Code so it displays correctly.
If you don't want to post it here you can PM me.
BirdOPrey5
12-15-2010, 05:10 PM
Right off the bat I see you don't have an ending <vb:else> tag and </vb:if> close tag.
You need one of each... try putting
<vb:else />
<title>{vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
</vb:if>
at the end of your "elseif" statements... directly below the line:
<vb:elseif condition="$thread[forumid] == " 95/>
<title>Saab| {vb:raw thread.prefix_plain_html} {vb:raw thread.title}</title>
cbishwaraj
12-15-2010, 06:05 PM
Great ! BirdOPrey5
I appreciate your continuous help. God bless you.
Now all done.
THANK YOU SO MUCH.
cbishwaraj
BirdOPrey5
12-15-2010, 06:52 PM
Good Luck :up: You sure put a lot of work into typing all that out. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.