On Tue, Aug 19, 2014 at 3:41 PM, Jared Bownds <[email protected]>
wrote:
>
> Well, you would have had to extrapolate on what I told you previously to
>> replace "shared" with "site" for the case that you've put the CSS files in
>> your environment htdocs directory rather than a shared htdocs directory.
>> but I assumed you'd ask more questions if you didn't understand that part.
>>
>
> This is definitely a learning process for me, but I appreciate your
> feedback and assistance. I have an additional question if you are up for
> it.
>
> I've successfully implemented the TracLayoutRecipe, all except for one
> notable feature. In contrast to edge wall's site, I noticed there is
> feedback in terms of what global navigation link you are currently viewing
> (see *edgewall example*). If you notice the other screenshot (local
> instance), this same behavior is not expressed - what did I miss?
>
Each project has a `name` attribute that is set through the [project]
section of trac.ini. The template does a comparison with the project name
to determine the active navigation item. Take a look at this code, starting
at line 25 in site.html:
<ul>
<!--! The following block of list items is the top navigation bar,
that allows quick jumps between the available projects.
Currently it includes the projects of Edgewall Software, as
examples.
You will need to modify the list according to your projects.
Note that each list item (except for 'Home') has a class
property
that is assigned "active" if the current project is the
active one.
You will also need to modify the tests for every item to
check
against the correct name of each project.
In addition, each anchor element has a class that allows
formatting
each item independently from other items (see projects.css)
-->
<li><a href="http://www.edgewall.org/">Home</a></li>
<li class="${project.name=='The Trac Project' and 'active' or
None}">
<a class="trac" href="http://trac.edgewall.org/">Trac</a>
</li>
<li class="${project.name=='Genshi' and 'active' or None}">
<a class="genshi" href="http://genshi.edgewall.org/">Genshi</a>
</li>
<li class="${project.name=='Babel' and 'active' or None}">
<a class="babel" href="http://babel.edgewall.org/">Babel</a>
</li>
<li class="${project.name=='Bitten' and 'active' or None}">
<a class="bitten" href="http://bitten.edgewall.org/">Bitten</a>
</li>
<li class="${project.name=='Posterity' and 'active' or None}">
<a class="posterity" href="http://posterity.edgewall.org/
">Posterity</a>
</li>
Assuming your project names match the text displayed on the navigation item
in your screen capture (and if they don't you should consider making them
match):
<li class="${project.name=='CLS West Sacramento' and 'active' or
None}">
<a href="<insert url of CLS West Sacramento>">CLS West
Sacramento</a>
</li>
As far as I can tell the class attribute (e.g. class="genshi" in the
original template) isn't used anywhere, so I've omitted it.
Note you could also improve the code a bit if it is indeed true that the
"Project name matches the text displayed on the navigation item", and
you've also set the URL for the project in the [project] section of trac.ini
<li class="${project.name=='CLS West Sacramento' and 'active' or
None}">
<a href="$project.url">$project.name</a>
</li>
That could make things a bit cleaner. I haven't tested that, so make one
change at a time and watch out for stupid errors I might have made in
typing this out ;)
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.