Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » problem in using $URLSegment

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: 1130 Views
  • ojalà
    Community Member
    87 Posts

    problem in using $URLSegment Link to this post

    I read some topic in forum and I understand that to change some part of theme in a new page type like Headero footer I must use this variable.
    So in my tutorial/layout/NewTypePage.ss I write

    <body id="$URLSegment">

    and in the css in themes/css

    #segment1 #Header{

    How I must replace instead of segment1?

  • Willr
    Forum Moderator
    5508 Posts

    Re: problem in using $URLSegment Link to this post

    Segment 1 would be the url of your page. Eg on the 'home/' page you would have <body id="home"> on the 'services/' page you would have <body id="services"> etc then in the css you would have to do #services or #home

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.