Page Title Meta.

  • Betroffene Version
    WoltLab Suite 3.1

    Hello, I was wondering if anyone knows where the page title meta gets its "- Site Title" from, I would very much like to remove that. I want the title to be, what I want the title to be, not

    "My Title - My Site" which is currently what it is.

  • Hello,

    It uses the "Page Title" as specified in the options in your admin panel.

    Thanks very much, that covers half of the issue lol.

    So now it says "Page Title -" Instead of "Page Title - Page Title General"

    How can I get rid of the - that is now at the end?

    this is my OG code on page source now,

    Code
    <meta property="og:title" content="Home - ">

    I assumed before, it was PHP inserting that "- Page Title" and now its still inserting the dash.

    • Offizieller Beitrag

    Hello,

    This is provided in a template, in particular line 11 of the header template.

    Code
    <title>{if $pageTitle}{@$pageTitle} - {/if}{PAGE_TITLE|language}</title>

    As you may see, the system does allow the page's own title to be empty, which in your case would result in an empty title.

    Now, before you make any change to the template via FTP: Stop right now. Do not touch the files, like, ever. Instead, use the admin panel to make the change, you get the same power, but completely safe for updating: Custom Templates.

    You got the template group with the template all set up? Splendid, we can now continue with the change, I would suggest this line instead:

    Code
    <title>{if $pageTitle}{@$pageTitle}{else}{PAGE_TITLE|language}{/if}</title>

    That code will only print the "general page title" if the page does not set an title on its own, otherwise it will only show the page's title. However, this requires you to fill out the global page title, and while it may look neat to set it to an empty value, I strongly recommend against it. It is used all over the software and in third party plugins, setting it to an empty value would break the expectation that comes with it.

  • Cool thanks, and yes I know to edit templates only :)

    Edit: YA, that didnt fix the issue for me. It did update the <title> </title> However the Open Graph, which is what I am concerned with is still doing it. Our site is going to be linked in discord, ALOT, open graph is what I am concerned about that is what Discord is pulling.

    Edit 2: Okay, I replaced the non empty title as per your recommendation, which is fine, I have no issues with pages with no title showing site title as the code you provided has done. However, once again the OG title is now right back to what it was before doing this lol.

    If it helps any, as you had suggested before, whatever is doing this, is only doing it to non system pages. System pages, have no OG title at all, only non system pages.

    4 Mal editiert, zuletzt von cyberlocc (21. Januar 2019 um 00:54)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!