Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Removing Page Titles

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2124 Views
  • lenwood
    Community Member
    18 Posts

    Removing Page Titles Link to this post

    Hi All,
    I'm in the process of customizing my SS site, and I'd like to remove the page title from each page. As it is right now, when someone clicks 'Home' on my site, that selection on the nav menu is highlighted, the browser header says 'Home', and its an H2 tag at the top of the content. Thats too much Home for me. I've searched through the code, and I can't find the piece I'm looking for.

    Here's what I'd like:
    Browser header = Site Name | Home
    Nav Bar = 'Home' is highlighted
    H2 Tag = 'Welcome to Site Name'

    Any help with this is much appreciated.

  • Willr
    Forum Moderator
    5502 Posts

    Re: Removing Page Titles Link to this post

    If you are using the blackcandy theme then open themes/blackcandy/templates/Page.ss and look for $MetaTags in the head section. If you want a custom title you can pass MetaTags false and write your own

    <title>$Title | My Super Awesome Site</title>

    The h2 title is controlled within the CMS. You can change it to whatever you want.

  • Jayson
    Community Member
    2 Posts

    Re: Removing Page Titles Link to this post

    I am brand new to SilverStripe as of yesterday but faced this same question, and solved it, and thought I would share my learning for others.

    Ok I got a site up quickly then installed a theme and wanted to get rid of the word "Home" in the title bar of the browser, and also the word "Home" that appeared on the top of my home page itself. It took me soooooo long to figure this out . the answer from the previous poster works perfect for changing the Title bar text (thanks!!). Now, as for word "Home" stuck on the top of my home page... you need to read the Basic Tutorial and follow each step about creating a home page that is different from the other pages. However since I had installed a theme, instead of creating HomePage.php in tutorial/code, I created it in mysite/code. And instead of creating HomePage.ss in tutorial/templates I created it in themes/mytheme/templates. But actually I didn't even do that. I just went into themes/mytheme/templates/layout and copied Page.ss to HomePage.ss, then commented out the lines that added the word "Home" like this:
    <!-- <div class="header">
                </div> -->

    Sounds easy now and you experts are reading this and thinking what a goofball but it took a lot of searching to figure this out. Hope it benefits someone.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.