Posted By: Gladius Page Titles - 12/23/2005 6:03 AM
Not exactly a "new members" question, but probably fits in here best...

Anyway, I'd like to change the titles of the ultimatebb.cgi page and the forum thread listing pages, and I'm having some problems... Namely, I can't seem to find any separation for these sections in public_common.pl, or even for threads themselves. If I add some text to the first title tag in public_common.pl, it'll display that on every single page, from the forum summary, to thread listing and actual posts themselves. I'd like to prevent it from showing on the thread pages, however, since these will generally have long titles already anyway, and the text I'm hacking in wouldn't show whole, so it'd look lame having it there.

In short, is there a way to add some text to the title tags on ultimatebb.cgi and the thread listing pages for forums, and if, how can I do it? Thanks.
Posted By: Charles Capps Re: Page Titles - 12/23/2005 8:56 AM
You have two options.

First, you can alter the calls to generic_wrapper to include a page_title (or page_name...) for each of the pages you wish to modify.

Or second, you can modify generic_wrapper to twiddle with the page title as needed, which'll be a bit more on the complex side.
Posted By: Gladius Re: Page Titles - 12/23/2005 4:51 PM
I'm afraid you've lost me there - I'm not that familiar with UBB's code to know where to look for that, or what exactly the page_title/page_name difference is... could you give me some specific instructions here please? Just putting the text in the title of ultimatebb.cgi would already work for me, the forum threads listing pages would just be a bonus. smile

Happy Holidays!
Posted By: Charles Capps Re: Page Titles - 12/24/2005 6:01 AM
Bah, slacker! wink

generic_wrapper is the name of the sub in public_common that's responsible for the generation of most of the top of the page. "Top of the page" generally means just the actual visible HTML, but it can also set the page title.

Most generic_wrapper calls are in templates. For example, the one for the forum summary is in public_forum_summary. Real shocker there.

page_name and page_title?

page_title is only the title tag.

page_name, if set, is BOTH the title tag AND the name of the page in the breadcrumbs (if no other breadcrumb is specified). The two are often the same... but not always.

Compare the generic_wrapper call on line 20 of public_forum_page with the generic_wrapper call on line 10 of public_forum_summary for varying arguments, etc.
Posted By: Gladius Re: Page Titles - 12/27/2005 7:57 PM
I've been away for a few days so I couldn't reply sooner...

Regarding page_title/page_name difference; ok, that makes sense... I'll want to edit page_title then.

However, after comparing those two templates, I still have no idea how to force a certain title for a specific page... There's no such thing done there so I could extrapolate from, as far as I can see.
Posted By: Gladius Re: Page Titles - 12/30/2005 8:15 PM
Posted By: Gladius Re: Page Titles - 01/02/2006 10:10 PM
Pretty please, with a cherry on top?
Posted By: Charles Capps Re: Page Titles - 01/04/2006 6:14 AM
Mmm, cherries.

If you want to change the title for a page, change the template that generates the page. smile

Yes, it's really that simple. Be sure to clear the cache after each change, of course.
Posted By: Gladius Re: Page Titles - 01/04/2006 2:18 PM
Did I mention that I couldn't find a specific template for ultimatebb.cgi to edit? laugh

I've looked everywhere and couldn't find it, so please point me in the right direction...
Posted By: Charles Capps Re: Page Titles - 01/05/2006 8:32 AM
public_forum_summary. Sorry, too subtle above. smile

(There's no one-to-one correlation for scripts and templates.)
Posted By: Gladius Re: Page Titles - 01/09/2006 3:03 AM
Ok... so I'm guessing I should be editing this here:

my $hf = &generic_wrapper({
page_title => "",
before_navbar => qq~</font></td><td align="right">
But how exactly? I want to simply insert a chunk of my own text after the existing page title text.
Posted By: AllenAyres Re: Page Titles - 01/09/2006 6:47 PM
I believe you'd add it here, wouldn't you?

page_title => "",
Posted By: Gizmo Re: Page Titles - 01/10/2006 2:23 AM
page_title => "Gizmo is Bestest!",
Posted By: Gladius Re: Page Titles - 01/14/2006 2:59 AM
Oh.... I assumed that'd change the entire page title (which I don't want). I'll give it a try, thanks.
© UBB.Developers