Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

644 Posts in 185 Topics by 252 members

Themes

SilverStripe Forums » Themes » Control Blocks and special classes

Discuss SilverStripe Themes.

Page: 1
Go to End
Author Topic: Control Blocks and special classes 603 Views
  • papilindo
    avatar
    Community Member
    1 posts

    Control Blocks and special classes Link to this post

    Hey hows it going guys? I just started using silverstripe its pretty nice I like it. I am trying to use a control block for my nav in the header but I want the first and last items in the nav to have special css classes/styling can this be done and some tips would be much appreciated .Thank you in advance.

    Just found out about using < % If first %> but it duplicates the first element !!!!

    Ok so I think I solved my own problem

             <% control Menu(1) %>
                <% if first %>
                <li class="wider "><span>&#8195;</span><a href="#">$MenuTitle</a></li>
                <% else_if last %>
                <li class="wider no_background"><span>&#8195;</span><a href="#">$MenuTitle</a></li>
                <% else %>
                <li><span>&#8195;</span><a href="#">$MenuTitle</a></li>      
                <% end_if %>
             <% end_control %>

    I ended up using ifs and else ifs and it stopped the duplicating

    Plz do not mark this as spam I am sure this will help a fellow beginner

  • Nivanka
    avatar
    Community Member
    337 posts

    Re: Control Blocks and special classes Link to this post

    this is the way you have to do it, thanks for posting the hack.

    603 Views
Page: 1
Go to Top

Currently Online: ayyurek, dotperinch, dendeffe

Welcome to our latest member: nkdweb

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

Comments on this website? Please give feedback.