[Radiant] Navigation and using Snipets for global variables

Harvey Bernstein hb at bsemple.com
Mon Jul 17 07:55:00 CDT 2006


Hi guys

On my home page I have a page part called menubar which uses the following
snipet.  

<div id="menubar">
  <div id="navcontainer">
    <ul id="navlist">
      <r:find url="/">
        <r:children:each>
          <li><a href="<r:url />" title="Click here to find out more about
<r:breadcrumb />"><r:title /></a></li>
        </r:children:each>
      </r:find>
    </ul> 
  </div>
</div>

This displays the main navigation and works well.  I only have one issue
with it.  I would like to highlight to the user which section they are
currently in.  The CSS has been setup so all I actually need to do is
something like this, by just using the class = "on":-

   <li class="on"><a href="#">Extranet</a></li>


At the moment, I am thinking about having to create separate menubar
snippets for each section and using some kind of if statement.  Is there a
simple way to do what I need?

My next question relates to using snippets as global variables.  I wanted to
create a snippet called CompanyName.  I wanted this snippet to use textile
and simple be the company name e.g. *Company Name*.  I figured that if the
company named changed it would be child's play to change it throughout the
website.  

The only problem is that when I call the snippet it adds a line break which
is no good as it would be typically put into regular paragraphs.  Is there
anyway to achieve global variables for a website?

Thanks in advance
Harvey


This e-mail has been scanned for all viruses by MessageLabs.



More information about the Radiant mailing list