Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

hide submenu

i have this:
    <div id="linkListSub">
        <hr />
        <h3 class="select"><span>Sottomenu</span></h3>
        <ul>        
        {$ foreach x in (and thisFolder (not (filename "index"))) $}
              <li><a href="{$x.link$}">{$x.headline$}</a></li>
        {$next$}
        </ul>
    </div>

it display me submenu... if i want hide it whene there is no article in it how i can do?
tnx

webmaster
Friday, September 19, 2003

Have a look at these two help files:

http://www.fogcreek.com/CityDesk/2.0/help/Scripting_With_CityScript/AlternateTextforEmptyLoop.html

http://www.fogcreek.com/CityDesk/2.0/help/Scripting_With_CityScript/FancyLoops.html

Basically you need to put your div start to ul elements in a {$ before $}, and the end /ul to end /div in a {$ after $}. That way, if the foreach actually finds anything, it will first start the div and ul, and then when it's finished looping it will close off the ul and div.

This is assuming you're using CD2.0, which is a free upgrade to CD1.0.

www.ianmjones.net
Friday, September 19, 2003

        {$ foreach x in (and thisFolder (not (filename "index"))) $}
              <li><a href="{$x.link$}">{$x.headline$}</a></li>
        {$ before $}
    <div id="linkListSub">
        <hr />
        <h3 class="select"><span>Sottomenu</span></h3>
        <ul>        
        {$ after $}
        </ul>
    </div>
        {$ next $}    

works for me thanks

webmaster
Friday, September 19, 2003

*  Recent Topics

*  Fog Creek Home