Chibang Dayanan
Chibang Dayanan

Reputation: 189

Creating a blank/dummy SilverStripe 3.0 Page

How can I add blank or dummy pages to SS 3.0? I have been trying to create a dropdown list that would also include, supposed to be, blank pages or pages with no links as a placeholder to level out the navigation. Kindly check out the image provided for clarity.

enter image description here

Will this be possible in silverstripe?

Upvotes: 1

Views: 179

Answers (1)

Zomxilla
Zomxilla

Reputation: 467

If I understand you correctly, you're wanted to insert a placeholder inside of a loop within your template. For example, when you're making a menu, you loop through $Level(1).

So if you were wanting to place a blank element in a certain spot during that loop, I would recommend using a conditional. SilverStripe conditionals aren't incredibly powerful, but they are very easy to understand.

Review SilverStripe's template documentation. You can find loops here too.

As an example, you could do this:

<li><a href="$Link">$MenuTitle</a></li>
<% if $Pos == 5 %>

    <li class="separator"></li>

<% end_if %>

<% end_loop %>

This will place an <li> of class separator after the fifth item.

Upvotes: 2

Related Questions