How to put the topic title before site name in overall header file?

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
WWu777
Registered User
Posts: 802
Joined: Tue Aug 14, 2007 12:40 pm
Contact:

How to put the topic title before site name in overall header file?

Post by WWu777 »

Dear support,

I'm currently editing the installation files in my phpbb 3.2 installation package.

If I want to change the title tag so that the topic title appears first and then the site name after, what do I change in the code below from the overall header file so that it displays in search results like this "Topic Title - Site Name":


<title><!-- IF UNREAD_NOTIFICATIONS_COUNT -->({UNREAD_NOTIFICATIONS_COUNT}) <!-- ENDIF --><!-- IF not S_VIEWTOPIC and not S_VIEWFORUM -->{SITENAME} - <!-- ENDIF --><!-- IF S_IN_MCP -->{L_MCP} - <!-- ELSEIF S_IN_UCP -->{L_UCP} - <!-- ENDIF -->{PAGE_TITLE}<!-- IF S_VIEWTOPIC or S_VIEWFORUM --> - {SITENAME}<!-- ENDIF --></title>


Btw why does the site title showing first before the topic title? It should be topic title first. That's much better for SEO. So why isn't it the default too? I thought that would have been fixed by now?

Also, is there a way to make the topic title longer when submitting posts? I find that some titles are too long for the post forum. Can that field be made longer in the post form? The title field on this forum seems to allow you to have longer titles than the default.

Thanks.
Last edited by bonelifer on Tue Nov 21, 2017 6:07 pm, edited 4 times in total.
Reason: Unlocked: See https://www.phpbb.com/community/viewtopic.php?p=14870011#p14870011
WWu777
Registered User
Posts: 802
Joined: Tue Aug 14, 2007 12:40 pm
Contact:

Re: How to put the topic title before site name in overall header file?

Post by WWu777 »

Any idea? Should be a very simple edit right?

This is for the installation files for phpbb 3.2 btw. I've edited the OP to reflect that so there's no misunderstanding.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26455
Joined: Fri Aug 29, 2008 9:49 am

Re: How to put the topic title before site name in overall header file?

Post by Mick »

The support forums are for assistance with vanilla phpBB not for custom coding requests. It isn’t recommended to edit core files in 3.2, that’s what extensions are for. Where you’re looking to make changes to how the core code works you should have a search of the extensions forums and, if you don’t find what you need, you can make an extension request. Alternatively you can post in the *phpBB Custom Coding forum where someone *may* be able to help you.

* Note: There’s no official support in the Custom Coding forum.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
WWu777
Registered User
Posts: 802
Joined: Tue Aug 14, 2007 12:40 pm
Contact:

Re: How to put the topic title before site name in overall header file?

Post by WWu777 »

So you mean I can't ask any code or html questions on this board? In previous support boards I could. Why not anymore?

So the custom coding forum is the place to ask such questions?

You do realize that the default template that puts the site name before the topic title is very bad for SEO don't you? Why wasn't that fixed long ago? This is basic SEO 101 and common sense too.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26455
Joined: Fri Aug 29, 2008 9:49 am

Re: How to put the topic title before site name in overall header file?

Post by Mick »

WWu777 wrote: Mon Nov 20, 2017 1:57 am So you mean I can't ask any code or html questions on this board? In previous support boards I could. Why not anymore?
Correct, but not the whole board just in the support forums because we don’t recommend editing core code anymore. It’s best to leave it to the experts, extension questions in the extensions forums styles in styles.
WWu777 wrote: Mon Nov 20, 2017 1:57 amSo the custom coding forum is the place to ask such questions?
If you don’t want to request/wait for an extension.
WWu777 wrote: Mon Nov 20, 2017 1:57 amYou do realize that the default template that puts the site name before the topic title is very bad for SEO don't you? Why wasn't that fixed long ago? This is basic SEO 101 and common sense too.
No not personally, I’m not an SEO convert. If you think it’s a bug or requires changing you should report it in the bug tracker or maybe ideas. You can also try styles support. I’ll move this one to styles for you.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
WWu777
Registered User
Posts: 802
Joined: Tue Aug 14, 2007 12:40 pm
Contact:

Re: How to put the topic title before site name in overall header file?

Post by WWu777 »

Wait nevermind. It seems I was wrong. The default template is showing the topic title before the site title after all. I just looked at one of my topic pages and noticed the topic title is shown first in the title tags.

http://www.happierabroad.com/forum/view ... 15&t=29185

Btw can I ask coding or html questions in the Styles board? Thanks.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26455
Joined: Fri Aug 29, 2008 9:49 am

Re: How to put the topic title before site name in overall header file?

Post by Mick »

Yes so long as it’s relative to styles.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
Post Reply

Return to “[3.2.x] Styles Support & Discussion”