View Full Version : Changing the title of tag search pages in vB4?
svBK.vn
11-10-2011, 04:01 AM
Hi,
I need help with reformatting the title of the tag pages on my site http://svbk.vn/tags.php?tag=dien+dan+svbk
I need the title to change from
Search Results (kết quả t?m kiếm) - Dien dan sinh vien Bach Khoa
to
dien dan svbk - Dien dan sinh vien Bach Khoa
How do i change this in the templates. I'm running 4.1.3
Thanks in advance :)
Lynne
11-10-2011, 05:38 PM
template - <span class="comment">search_resultlist
Change this line to what you want:
<title>{vb:rawphrase search_results} - {vb:raw vboptions.bbtitle}</title>
If this is only for the tags page, then perhaps something like:
<title><vb:if condition="THIS_SCRIPT == 'tags'">dien dan svbk<vb:else />{vb:rawphrase search_results}</vb:if> - {vb:raw vboptions.bbtitle}</title>
svBK.vn
11-11-2011, 02:08 AM
Thank for you support but I need the title to change title of tag search page from:
Search Results (kết quả t?m kiếm) - Dien dan sinh vien Bach Khoa
to
<tag's name I search> - Dien dan sinh vien Bach Khoa
Example: when I search abc tag, title of tag search page will be:
abc - Dien dan sinh vien Bach Khoa
when I search def tag, title of tag search page will be:
def - Dien dan sinh vien Bach Khoa
It's look like this page: http://www.vbseo.com/tags/vbulletin/
svBK.vn
11-14-2011, 11:46 AM
Who can help me? :(
Lynne
11-14-2011, 04:42 PM
Just write a plugin like:
hook location - search_complete
$this->template->register('criteria', $_GET['tag']);And then use the variable criteria in the <title> tag.
Probably should clean it first. So...
$vbulletin->input->clean_array_gpc('r', array(
'tag' => TYPE_STR,
));
$this->template->register('criteria', $vbulletin->GPC['tag']);
svBK.vn
11-16-2011, 01:13 PM
Solved. I've done it!
Thank you so much :x
Lynne
11-16-2011, 08:42 PM
You may need to put a condition around that to only do it on the tags.php page (use THIS_SCRIPT) since that hook gets called on the regular search page also.
svBK.vn
11-18-2011, 12:35 AM
OK, Thank you very much again :X
svBK.vn
11-28-2011, 08:42 AM
Sorry, I have a problem with this plugin: When I try to view http://svbk.vn/search.php (and some profiles page), it gives me a 500 error saying:
http://nf0.upanh.com/b4.s5.d1/e1456353d6a96c23d81f76b1c6a6ddb7_38369060.1.jpg
When I disable this plugin, everything works normally so I think this plugin cause the error.
Who can help me? Thanks in advance :)
Lynne
11-28-2011, 05:06 PM
Did you put a condition around the plugin so it's only used for tags as I suggested in post 7?
svBK.vn
11-29-2011, 01:05 AM
Sorry, I did not put a condition around the plugin so it's only used for tags because I don't know how to do it :(
Can you help me please? :)
Lynne
11-29-2011, 02:50 AM
if(THIS_SCRIPT == 'tags') {
$vbulletin->input->clean_array_gpc('r', array(
'tag' => TYPE_STR,
));
$this->template->register('criteria', $vbulletin->GPC['tag']);
}
svBK.vn
11-29-2011, 10:15 AM
Thank Lynne very much!!! :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.