1

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?

4

1 回答 1

2

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.

于 2013-08-30T03:12:41.047 回答