Jump to:

1384 Posts in 493 Topics by 522 members

Themes

SilverStripe Forums » Themes » SiteTitle and Tagline in templates

Discuss SilverStripe Themes.

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

Page: 1 2 3
Go to End
Author Topic: 6600 Views
  • patjnr
    Avatar
    Community Member
    101 Posts

    Re: SiteTitle and Tagline in templates Link to this post

    yurigoul

    i have tested you code below and it works fine.
    i was just wondering in what circumstances can you use it when its under SiteConfig.

    thx

    PAt

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: SiteTitle and Tagline in templates Link to this post

    I am not sure what you are asking.

    I use it when working with a css menu with image replacement, so you can say: that page corresponds with that position in the menu. There are also other ways to do that, for instance create a page-class where the name corresponds with the the css class or id in the menu and later on gives the body class etc.

    Or do you mean: how to get the info out of there?

    To get the link to the pages it works like this:
    You store the id in $SiteConfig.PortfolioID, but to get the link in your templates you use $SiteConfig.Portfolio.Link

    BTW: in php you get access to the data with DataObject::get_one('SiteConfig', '');

  • patjnr
    Avatar
    Community Member
    101 Posts

    Re: SiteTitle and Tagline in templates Link to this post

    hi

    well said in a nutshell. thank you very much for sharing appreciate that

    ta PAt

  • inCharge
    Avatar
    Community Member
    102 Posts

    Re: SiteTitle and Tagline in templates Link to this post

    Nice, thanks. Perfect for the Google Analytics account number. Also, if there are a lot of contact forms on a site, SiteConfig would be good for the From & To email addresses. Also header & footer stuff like phone/address...

    Think I'll be including this in all my SilverStripe sites from now on...

    jeremykiveo: Would be nice to change updateEditFormFields to updateCMSFields in your blog post.

    6600 Views
Page: 1 2 3
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.