Remember me? forgot password | register

SilverStripe Forum

10691 Posts in 2798 Topics by 1519 members

Jump to:

Site Builders

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Community » SilverStripe Forum » Site Builders » if with or, or somethings else ;-)
Page: 1 go to end Reply
Author Topic: if with or, or somethings else ;-) 523 views
  • UnrealMinds
    avatar
    Community Member
    4 posts

    if with or, or somethings else ;-) Link to this post

    Hello @all!

    I have a simple menu, but I wanted to have some spaces between at some positions.

    like:
    ***********
    Home
    <br />
    Contact
    Impress
    <br />
    News
    ***********

    So, I have to inklude:
    <% if Pos = 2 %>
    <li style="height: 5px;">&nbsp;</li>
    <% end_if %>

    But for the secound spacer I wouldn't like to write:
    <% if Pos = 4 %>
    <li style="height: 5px;">&nbsp;</li>
    <% end_if %>

    How can I made this with only one if-statement?

    <% if Pos = 2 || Pos = 4 %>
    <% if (Pos = 2) || (Pos = 4) %>
    <% if Pos = 2 or Pos = 4 %>
    <% if (Pos = 2) or (Pos = 4) %>
    has the only effect that the site will be blank. ;-)

    Last edited: 16 May 2008 at 1:51am

  • UnrealMinds
    avatar
    Community Member
    4 posts

    Re: if with or, or somethings else ;-) Link to this post

    does no one have an idea?

  • bruceb
    avatar
    Community Member
    16 posts
    1 SilverStripe Site

    Re: if with or, or somethings else ;-) Link to this post

    Are the breaks determined by the menu items themselves or just the position? If its the menu items, you could add a new field to the relevant page type called 'MenuSpace', then use the value of that field in your if statement to decide whether to insert a space above the item.

    cheers
    bruce

  • UnrealMinds
    avatar
    Community Member
    4 posts

    Re: if with or, or somethings else ;-) Link to this post

    Thanx, for this idea.

    I will try to do so ;-)

    523 views
go to top Reply

Currently Online:

François, patrics, Apophenian, Aster

Welcome to our latest member: patrics