Updating header title - can't get it right

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
haggisv
Registered User
Posts: 261
Joined: Wed Dec 20, 2006 3:31 am
Location: Adelaide, Australia
Contact:

Updating header title - can't get it right

Post by haggisv »

I'm trying to change the title of my page (header title shown top left of browser page).
On my home page I want:
forum_name

Within a forum I want:
topics_name - forum_name

Within a thread I want:
thread_title - forum_name

This is what i have in my overall_header.html

Code: Select all

<title>{PAGE_TITLE} <!-- IF S_IN_MCP -->{L_MCP} . " - " <!-- ELSEIF S_IN_UCP -->{L_UCP} . " - " <!-- ENDIF -->{SITENAME}</title>
All the right bits are there with this code, but I can't get it to space out with " - " in between... it just puts a single space in between the terms.

Can anyone advice?
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Updating header title - can't get it right

Post by Oyabun1 »

Browsers tend to collapse white space, so if you want some extra spaces in there you will probably need to use the HTML element &nbsp; rather than entering a space with your keyboard.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
haggisv
Registered User
Posts: 261
Joined: Wed Dec 20, 2006 3:31 am
Location: Adelaide, Australia
Contact:

Re: Updating header title - can't get it right

Post by haggisv »

Tried it.. it still doe snot seem to work!

This is the code

Code: Select all

<title>{PAGE_TITLE} <!-- IF S_IN_MCP -->{L_MCP}. &nbsp; . "-" . &nbsp; <!-- ELSEIF S_IN_UCP -->{L_UCP}. &nbsp; . "-" . &nbsp; <!-- ENDIF -->{SITENAME}</title>
All it does is put a single space in between... it ignores the other space and the "-"

I've tried it on both firefox and IE8
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Updating header title - can't get it right

Post by Oyabun1 »

If you want multiple 3 spaces enter &nbsp;&nbsp;&nbsp;.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
haggisv
Registered User
Posts: 261
Joined: Wed Dec 20, 2006 3:31 am
Location: Adelaide, Australia
Contact:

Re: Updating header title - can't get it right

Post by haggisv »

No I want a space-dash-space (ie " - ") in between them...why does it not work???
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Updating header title - can't get it right

Post by Oyabun1 »

Sorry, I just reread your post again. The reason that it's not working is you are changing the wrong code. If it's the words that are displayed on the page and not the actual page title element that you want to change then the code to change, assuming a prosilver based style, is in the line below

Code: Select all

			<ul class="linklist navlinks">
in overall_header.html.

The <title> element of a HTML page is not displayed on the page.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
haggisv
Registered User
Posts: 261
Joined: Wed Dec 20, 2006 3:31 am
Location: Adelaide, Australia
Contact:

Re: Updating header title - can't get it right

Post by haggisv »

The page title is shown at the top left of the browser bar. Yes I do want to change the page "title" element. I'm using subsilver2.
User avatar
haggisv
Registered User
Posts: 261
Joined: Wed Dec 20, 2006 3:31 am
Location: Adelaide, Australia
Contact:

Re: Updating header title - can't get it right

Post by haggisv »

Anyone please?
User avatar
Mick
Support Team Member
Support Team Member
Posts: 22955
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket probably.

Re: Updating header title - can't get it right

Post by Mick »

Can you post EXACTLY how you want it to appear in plain text please? Also, for general HTML programming questions you can also try the w3schools HTML tutorial, there are tons of examples.
"The more connected we get the more alone we become" - Kyle Broflovski©
User avatar
haggisv
Registered User
Posts: 261
Joined: Wed Dec 20, 2006 3:31 am
Location: Adelaide, Australia
Contact:

Re: Updating header title - can't get it right

Post by haggisv »

OK, I just want the title element of a page to be as follows:

For posts
posts title - forum name

For catagories

catagory - forum name

For example for my own forum (called OOAK Table Tennis Forum) in a post called "Best table tennis blades", I want it to read:

Best table tennis blades - OOAK Table Tennis Forum

Yes I've brushed up on my HTML, but it simply does not seem to work...
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52227
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Updating header title - can't get it right

Post by Brf »

The place you have edited the extra spaces is for the UCP and MCP. If you want to change the actual PAGE_TITLE then you have to edit the PHP file when it calls page_header
User avatar
haggisv
Registered User
Posts: 261
Joined: Wed Dec 20, 2006 3:31 am
Location: Adelaide, Australia
Contact:

Re: Updating header title - can't get it right

Post by haggisv »

I'm afraid that PHP code for that is beyond my skills... If you're willing to take a look into that, I would very much appreciate it!
User avatar
HGN
Former Team Member
Posts: 4706
Joined: Wed Dec 03, 2008 1:53 pm
Location: The Netherlands
Name: Alfred
Contact:

Re: Updating header title - can't get it right

Post by HGN »

Could you explain with a screenprint what you are trying to achieve.
The code you mention will modify the text shown in the tab of the browsersheet.
Following works for me:

Code: Select all

<title>{PAGE_TITLE}&nbsp;-&nbsp;<!-- IF S_IN_MCP -->{L_MCP}&nbsp;-&nbsp;<!-- ELSEIF S_IN_UCP -->{L_UCP}&nbsp;-&nbsp;<!-- ENDIF -->{SITENAME}</title>
Is that what you want or do you want to show the text somewhere on the page?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52227
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Updating header title - can't get it right

Post by Brf »

If you want:
haggisv wrote:For posts
posts title - forum name
viewtopic.php has this code:

Code: Select all

// Output the page
page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'], true, $forum_id);
The first thing you would do is remove the "View Topic" text like this:

Code: Select all

// Output the page
page_header($topic_data['topic_title'], true, $forum_id);
Then put the extra dash in your header like this:

Code: Select all

<title>{PAGE_TITLE} &nbsp; . "-" . &nbsp; <!-- IF S_IN_MCP -->{L_MCP}. &nbsp; . "-" . &nbsp; <!-- ELSEIF S_IN_UCP -->{L_UCP}. &nbsp; . "-" . &nbsp; <!-- ENDIF -->{SITENAME}</title>
Just as HGN explained.
User avatar
haggisv
Registered User
Posts: 261
Joined: Wed Dec 20, 2006 3:31 am
Location: Adelaide, Australia
Contact:

Re: Updating header title - can't get it right

Post by haggisv »

HGN wrote:Could you explain with a screenprint what you are trying to achieve.
The code you mention will modify the text shown in the tab of the browsersheet.
Following works for me:

Code: Select all

<title>{PAGE_TITLE}&nbsp;-&nbsp;<!-- IF S_IN_MCP -->{L_MCP}&nbsp;-&nbsp;<!-- ELSEIF S_IN_UCP -->{L_UCP}&nbsp;-&nbsp;<!-- ENDIF -->{SITENAME}</title>
Is that what you want or do you want to show the text somewhere on the page?
Thank you HGN and Brf! That works perfectly for all pages, except that the home page now has a "- " in front of the title, which does not look right.
Locked

Return to “[3.0.x] Support Forum”