Re: template question: how to show active section innav bar?

[email protected] Thu, 25 Aug 2005 17:07:24 +0200
Newsgroups gmane.comp.cms.campsite.general
Message-ID <OF2B463C98.DC3DEC6E-ONC1257068.0052DBB7-C1257068.00530AB5@mdlf.org>
This is a multipart message in MIME format.
--=_alternative 00530AAEC1257068_=
Content-Type: text/plain; charset="us-ascii"

Thanks Braja!

That totally worked. I'll add this to the new, slick online Campsite 
manual, and am including my navbar.tpl below in final form. - doug


<!-- NAV BAR -->

<div id="navtabs">

<!** local><!** issue current><!** section number 1>
<!** if section fromstart>
<span id="navtab_on">[<a href="<!** URI section>">SECTION 1</a>]</span>
<!** else>
[<a href="<!** URI section>">SECTION 1</a>]
<!** endif>
<!** endlocal>

<!** local><!** issue current><!** section number 2>
<!** if section fromstart>
<span id="navtab_on">[<a href="<!** URI section>">SECTION 2</a>]</span>
<!** else>[<a href="<!** URI section>">SECTION 2</a>]
<!** endif>
<!** endlocal>

<!** local><!** issue current><!** section number 3>
<!** if section fromstart>
<span id="navtab_on">[<a href="<!** URI section>">SECTION 3</a>]</span>
<!** else>
[<a href="<!** URI section>">BROCHURES</a>]<!** endif><!** endlocal>

<!** local><!** issue current><!** section number 4>
<!** if section fromstart><span id="navtab_on">[<a href="<!** URI 
section>">SECTION 4</a>]</span>
<!** else>
[<a href="<!** URI section>">SECTION 4</a>]
<!** endif>
<!** endlocal>


</div>








Aleksandar Brajanoski <[email protected]>
08/25/05 04:32 PM
Please respond to campsite-support

 
        To:     [email protected]
        cc: 
        Subject:        Re: [campsite-support] template question: how to show active section innav 
bar?


try this:

<!** local><!** issue current><!** section number 1>
<!** if section fromstart>
                 <div id="navtab_on">
                 [<a href="<!** URI section>">SECTION 1</a>]
                 </div>
<!** else>
                 [<a href="<!** URI section>">SECTION 1</a>]
<!** endif>
<!** endlocal>



[email protected] wrote:
> 
> Hm. I tried this, but it also didn't seem to work. Where are you
> suggesting putting the <!** if section fromstart>? Inside the <!**
> local directive>?
> 
> <div id="navtabs">
> 
> <!**if section fromstart is 1>
> <div id="navtab_on">
> <!** local><!** issue current><!** section number 1>[<a href="<!** URI
> section>">SECTION 1</a>]
> <!** endlocal>
> </div>
> <!** else>
> <!** local><!** issue current><!** section number 1>
> [<a href="<!** URI section>">SECTION 1</a>]
> <!** endlocal>
> <!**endif>
> 
> <**if section fromstart is 2>
> <div id="navtab_on">
> <!** local><!** issue current><!** section number 2>
> [<a href="<!** URI section>">SECTION 2</a>]
> <!** endlocal>
> </div>
> <!** else>
> <!** local><!** issue current><!** section number 2>
> [<a href="<!** URI section>">SECTION 2</a>]
> <!** endlocal>
> <!** endif>
> 
> <**if section fromstart is 3>
> <div id="navtab_on">
> <!** local><!** issue current><!** section number 3>
> [<a href="<!** URI section>">SECTION 3</a>]
> <!** endlocal>
> </div>
> <!** else>
> <!** local><!** issue current><!** section number 3>
> [<a href="<!** URI section>">SECTION 3</a>]
> <!** endlocal>
> <!** endif>
> 
> <**if section fromstart is 4>
> <div id="navtab_on">
> <!** local><!** issue current><!** section number 4>
> [<a href="<!** URI section>">SECTION 4</a>]
> <!** endlocal>
> </div>
> <!** else>
> <!** local><!** issue current><!** section number 4>
> [<a href="<!** URI section>">SECTION 4</a>]
> <!** endlocal>
> <!** endif>
> 
> </div>
> 
>  Aleksandar Brajanoski
>  <[email protected]>                  To:
>                            [email protected]
>  08/25/05 03:52 PM                cc:
>  Please respond to                Subject:        Re:
>  campsite-support         [campsite-support] template question: how
>                           to show active section in  nav bar?
> 
> try with <if section fromstart>
> 
> [email protected] wrote:
> >
> > I want to make a navigation bar, but one that has a different style
> > for the current section (the section where the reader is currently)
> > than the non-current ones. But when I try to use the example from
> the
> > CS documentation, it doesn't work, because it's based on <!**local>
> > directives.
> >
> >  Here's what I've tried, but it doesn't work.
> >
> > <div id="navtabs">
> > <!** local><!** issue current><!** section number 1>
> > <!**if section is current>
> > <div id=navtab_on>[<a href="<!** URI section>">SECTION NAME
> > 1</a>]</div>
> > <!** else>
> > [<a href="<!** URI section>">SECTION NAME 1</a>]
> > <!**endif>
> > <!** endlocal>
> >
> > <!** local><!** issue current><!** section number 2>
> > <!**if section is current>
> > <div id=navtab_on>[<a href="<!** URI section>">SECTION NAME
> > 2</a>]</div>
> > <!** else>
> > [<a href="<!** URI section>">SECTION NAME 2</a>]
> > <!** endif>
> > <!** endlocal>
> >
> > <!** local><!** issue current><!** section number 3>
> > <!**if section is current>
> > <div id=navtab_on>[<a href="<!** URI section>">SECTION NAME
> > 3</a>]</div>
> > <!** else>
> > [<a href="<!** URI section>">SECTION NAME 3</a>]
> > <!** endif>
> > <!** endlocal>
> >
> > and so on...
> >
> > But the <!** if section is current> doesn't seem to work, and all
> the
> > nav bar items are given the <div> of navtab_on, so it thinks they're
> > all current.
> >
> > Any ideas?
> 
> --
> Aleksandar Brajanoski
> Internet Development Manager
> Transitions Online
> Chlumova 22, 130 00 Praha 3
> Czech Republic
> 420 2 2278-0805 (extension 26)
> 420 2 2278-0804 (fax)
> http://www.tol.cz
> 
> TOL: Intelligent Eastern Europe!

-- 
Aleksandar Brajanoski
Internet Development Manager
Transitions Online
Chlumova 22, 130 00 Praha 3
Czech Republic
420 2 2278-0805 (extension 26)
420 2 2278-0804 (fax)
http://www.tol.cz

TOL: Intelligent Eastern Europe!



--=_alternative 00530AAEC1257068_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">Thanks Braja!</font>
<br>
<br><font size=2 face="sans-serif">That totally worked. I'll add this to the new, slick online Campsite manual, and am including my navbar.tpl below in final form. - doug</font>
<br>
<br>
<br><font size=2 face="sans-serif">&lt;!-- NAV BAR --&gt;</font>
<br>
<br><font size=2 face="sans-serif">&lt;div id=&quot;navtabs&quot;&gt;</font>
<br>
<br><font size=2 face="sans-serif">&lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 1&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** if section fromstart&gt;</font>
<br><font size=2 face="sans-serif">&lt;span id=&quot;navtab_on&quot;&gt;[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 1&lt;/a&gt;]&lt;/span&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** else&gt;</font>
<br><font size=2 face="sans-serif">[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 1&lt;/a&gt;]</font>
<br><font size=2 face="sans-serif">&lt;!** endif&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** endlocal&gt;</font>
<br>
<br><font size=2 face="sans-serif">&lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 2&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** if section fromstart&gt;</font>
<br><font size=2 face="sans-serif">&lt;span id=&quot;navtab_on&quot;&gt;[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 2&lt;/a&gt;]&lt;/span&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** else&gt;[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 2&lt;/a&gt;]</font>
<br><font size=2 face="sans-serif">&lt;!** endif&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** endlocal&gt;</font>
<br>
<br><font size=2 face="sans-serif">&lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 3&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** if section fromstart&gt;</font>
<br><font size=2 face="sans-serif">&lt;span id=&quot;navtab_on&quot;&gt;[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 3&lt;/a&gt;]&lt;/span&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** else&gt;</font>
<br><font size=2 face="sans-serif">[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;BROCHURES&lt;/a&gt;]&lt;!** endif&gt;&lt;!** endlocal&gt;</font>
<br>
<br><font size=2 face="sans-serif">&lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 4&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** if section fromstart&gt;&lt;span id=&quot;navtab_on&quot;&gt;[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 4&lt;/a&gt;]&lt;/span&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** else&gt;</font>
<br><font size=2 face="sans-serif">[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 4&lt;/a&gt;]</font>
<br><font size=2 face="sans-serif">&lt;!** endif&gt;</font>
<br><font size=2 face="sans-serif">&lt;!** endlocal&gt;</font>
<br>
<br>
<br><font size=2 face="sans-serif">&lt;/div&gt;</font>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Aleksandar Brajanoski &lt;[email protected]&gt;</b></font>
<p><font size=1 face="sans-serif">08/25/05 04:32 PM</font>
<br><font size=1 face="sans-serif">Please respond to campsite-support</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;[email protected]</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re: [campsite-support] template question: how to show active section &nbsp;innav bar?</font></table>
<br>
<br>
<br><font size=2 face="Courier New">try this:<br>
<br>
&lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 1&gt;<br>
&lt;!** if section fromstart&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;navtab_on&quot;&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 1&lt;/a&gt;]<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;<br>
&lt;!** else&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 1&lt;/a&gt;]<br>
&lt;!** endif&gt;<br>
&lt;!** endlocal&gt;<br>
<br>
<br>
<br>
[email protected] wrote:<br>
&gt; <br>
&gt; Hm. I tried this, but it also didn't seem to work. Where are you<br>
&gt; suggesting putting the &lt;!** if section fromstart&gt;? Inside the &lt;!**<br>
&gt; local directive&gt;?<br>
&gt; <br>
&gt; &lt;div id=&quot;navtabs&quot;&gt;<br>
&gt; <br>
&gt; &lt;!**if section fromstart is 1&gt;<br>
&gt; &lt;div id=&quot;navtab_on&quot;&gt;<br>
&gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 1&gt;[&lt;a href=&quot;&lt;!** URI<br>
&gt; section&gt;&quot;&gt;SECTION 1&lt;/a&gt;]<br>
&gt; &lt;!** endlocal&gt;<br>
&gt; &lt;/div&gt;<br>
&gt; &lt;!** else&gt;<br>
&gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 1&gt;<br>
&gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 1&lt;/a&gt;]<br>
&gt; &lt;!** endlocal&gt;<br>
&gt; &lt;!**endif&gt;<br>
&gt; <br>
&gt; &lt;**if section fromstart is 2&gt;<br>
&gt; &lt;div id=&quot;navtab_on&quot;&gt;<br>
&gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 2&gt;<br>
&gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 2&lt;/a&gt;]<br>
&gt; &lt;!** endlocal&gt;<br>
&gt; &lt;/div&gt;<br>
&gt; &lt;!** else&gt;<br>
&gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 2&gt;<br>
&gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 2&lt;/a&gt;]<br>
&gt; &lt;!** endlocal&gt;<br>
&gt; &lt;!** endif&gt;<br>
&gt; <br>
&gt; &lt;**if section fromstart is 3&gt;<br>
&gt; &lt;div id=&quot;navtab_on&quot;&gt;<br>
&gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 3&gt;<br>
&gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 3&lt;/a&gt;]<br>
&gt; &lt;!** endlocal&gt;<br>
&gt; &lt;/div&gt;<br>
&gt; &lt;!** else&gt;<br>
&gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 3&gt;<br>
&gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 3&lt;/a&gt;]<br>
&gt; &lt;!** endlocal&gt;<br>
&gt; &lt;!** endif&gt;<br>
&gt; <br>
&gt; &lt;**if section fromstart is 4&gt;<br>
&gt; &lt;div id=&quot;navtab_on&quot;&gt;<br>
&gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 4&gt;<br>
&gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 4&lt;/a&gt;]<br>
&gt; &lt;!** endlocal&gt;<br>
&gt; &lt;/div&gt;<br>
&gt; &lt;!** else&gt;<br>
&gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 4&gt;<br>
&gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION 4&lt;/a&gt;]<br>
&gt; &lt;!** endlocal&gt;<br>
&gt; &lt;!** endif&gt;<br>
&gt; <br>
&gt; &lt;/div&gt;<br>
&gt; <br>
&gt; &nbsp;Aleksandar Brajanoski<br>
&gt; &nbsp;&lt;[email protected]&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;To:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[email protected]<br>
&gt; &nbsp;08/25/05 03:52 PM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cc:<br>
&gt; &nbsp;Please respond to &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re:<br>
&gt; &nbsp;campsite-support &nbsp; &nbsp; &nbsp; &nbsp; [campsite-support] template question: how<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; to show active section in &nbsp;nav bar?<br>
&gt; <br>
&gt; try with &lt;if section fromstart&gt;<br>
&gt; <br>
&gt; [email protected] wrote:<br>
&gt; &gt;<br>
&gt; &gt; I want to make a navigation bar, but one that has a different style<br>
&gt; &gt; for the current section (the section where the reader is currently)<br>
&gt; &gt; than the non-current ones. But when I try to use the example from<br>
&gt; the<br>
&gt; &gt; CS documentation, it doesn't work, because it's based on &lt;!**local&gt;<br>
&gt; &gt; directives.<br>
&gt; &gt;<br>
&gt; &gt; &nbsp;Here's what I've tried, but it doesn't work.<br>
&gt; &gt;<br>
&gt; &gt; &lt;div id=&quot;navtabs&quot;&gt;<br>
&gt; &gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 1&gt;<br>
&gt; &gt; &lt;!**if section is current&gt;<br>
&gt; &gt; &lt;div id=navtab_on&gt;[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION NAME<br>
&gt; &gt; 1&lt;/a&gt;]&lt;/div&gt;<br>
&gt; &gt; &lt;!** else&gt;<br>
&gt; &gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION NAME 1&lt;/a&gt;]<br>
&gt; &gt; &lt;!**endif&gt;</font>
<br><font size=2 face="Courier New">&gt; &gt; &lt;!** endlocal&gt;<br>
&gt; &gt;<br>
&gt; &gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 2&gt;<br>
&gt; &gt; &lt;!**if section is current&gt;<br>
&gt; &gt; &lt;div id=navtab_on&gt;[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION NAME<br>
&gt; &gt; 2&lt;/a&gt;]&lt;/div&gt;<br>
&gt; &gt; &lt;!** else&gt;<br>
&gt; &gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION NAME 2&lt;/a&gt;]<br>
&gt; &gt; &lt;!** endif&gt;<br>
&gt; &gt; &lt;!** endlocal&gt;<br>
&gt; &gt;<br>
&gt; &gt; &lt;!** local&gt;&lt;!** issue current&gt;&lt;!** section number 3&gt;<br>
&gt; &gt; &lt;!**if section is current&gt;<br>
&gt; &gt; &lt;div id=navtab_on&gt;[&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION NAME<br>
&gt; &gt; 3&lt;/a&gt;]&lt;/div&gt;<br>
&gt; &gt; &lt;!** else&gt;<br>
&gt; &gt; [&lt;a href=&quot;&lt;!** URI section&gt;&quot;&gt;SECTION NAME 3&lt;/a&gt;]<br>
&gt; &gt; &lt;!** endif&gt;<br>
&gt; &gt; &lt;!** endlocal&gt;<br>
&gt; &gt;<br>
&gt; &gt; and so on...<br>
&gt; &gt;<br>
&gt; &gt; But the &lt;!** if section is current&gt; doesn't seem to work, and all<br>
&gt; the<br>
&gt; &gt; nav bar items are given the &lt;div&gt; of navtab_on, so it thinks they're<br>
&gt; &gt; all current.<br>
&gt; &gt;<br>
&gt; &gt; Any ideas?<br>
&gt; <br>
&gt; --<br>
&gt; Aleksandar Brajanoski<br>
&gt; Internet Development Manager<br>
&gt; Transitions Online<br>
&gt; Chlumova 22, 130 00 Praha 3<br>
&gt; Czech Republic<br>
&gt; 420 2 2278-0805 (extension 26)<br>
&gt; 420 2 2278-0804 (fax)<br>
&gt; http://www.tol.cz<br>
&gt; <br>
&gt; TOL: Intelligent Eastern Europe!<br>
<br>
-- <br>
Aleksandar Brajanoski<br>
Internet Development Manager<br>
Transitions Online<br>
Chlumova 22, 130 00 Praha 3<br>
Czech Republic<br>
420 2 2278-0805 (extension 26)<br>
420 2 2278-0804 (fax)<br>
http://www.tol.cz<br>
<br>
TOL: Intelligent Eastern Europe!<br>
</font>
<br>
<br>
--=_alternative 00530AAEC1257068_=--