PDA

View Full Version : Get titles to work in custom pages


Watson
10-10-2004, 01:14 PM
When I add a custom page my title at the top doesnt work, I am adding them in templates, and also putting in a page title when adding a new page but it doesnt seem to work at all, its just blank

Any help?

Watson

Brian
10-10-2004, 05:01 PM
Open your forum/includes/vba_cmps_include_bottom.php file and look for:
global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST;


Replace that with:
global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST, $pagetitle;


Then edit your 'adv_portal' template and look for:
<title>$vboptions[hometitle]</title>

Replace that with:
<title>$vboptions[hometitle] <if condition="$pagetitle"> - $pagetitle</if></title>

Our Sponsors
 

Watson
10-12-2004, 03:09 PM
ok did all that mate, but its not showing up for some reason :(

Pryce
10-19-2004, 05:16 PM
Agreed, not working...I'll dig into it a bit.

Our Sponsors
 

Pryce
10-19-2004, 05:43 PM
I think Brian misunderstood what you were asking for...

To use the page title from the CMPS page we have to set $pagetitle.

In forum/includes/vba_cmps_include_bottom.php find the original:

global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST;


Or the following if you've alread edited your files as Brian described:

global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST, $pagetitle;


And replace it with:

global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST, $pagetitle;

if(!$pagetitle)
$pagetitle = $pages['title'];



I did it that way because Brian was implying that $pagetitle could be set another way (perhaps in a custom page/module php file). This allows you to do it either way. :)

Brian
10-19-2004, 05:56 PM
$pagetitle *should* already be set in the construct_navbar() function if I remember correctly (that's how it's created for vB pages...)

Pryce
10-19-2004, 08:13 PM
If the page has the nav bar disabled would that affect it then?

Brian
10-19-2004, 09:19 PM
Yup, that could do it.

Pryce
10-21-2004, 04:48 AM
:) That was my issue then. Good luck Watson. Thanks again Brian!

Polo
11-22-2004, 10:22 AM
It worked for me :) thanks Brian. Shouldnt this be added by default to the CMPS .zip

I think is important.

Regs
01-13-2005, 12:01 PM
Finally! I couldn't find this anywhere for the longest time :D

Worked like a charm... votes for making this a sticky thread? Yah.

The yah's have it :D

Cheers,

~Regs.

Polo
01-13-2005, 12:38 PM
well.. i still think this should be added to the future versions of vbcmps :)

tormodg
01-21-2005, 04:22 PM
Hm...this is not working for me at all.

tormodg
01-21-2005, 04:39 PM
Ah...never mind. I pasted it right in the adv_no_perms whatever bit. Wrong place, obviously. Need some sleep. :)