I'd like to put the html code in one template file that I can use throughout my site with an MTInclude tag (instead of having to maintain the navbar code in three or more separate templates). But I'm a little unsure how to do that.
Basically, I'd put the navbar code into a new template (e.g. "horizontal_navbar"). Then I'd use an MTInclude statement in my Main Index, Master Archive Index and About page templates to pull in the navbar code. But since the navbar code will be different based on which page has the focus, it will need to have conditional sections that are called in for the particular template. That's the part I don't know how to do.
Can anyone give me an example of how to apply this?
For example. Here's the basic code in Elise's article...
CODE
<div id="nav">
<a href="http://www.yoursite.com/about.html">about</a> | <a href="http://www.yousite.com/archives.html">archives</a> | <a href="http://www.yoursite.com/contact">contact</a> | <a href="http://www.yoursite.com/index.xml">rss</a>
</div>
<a href="http://www.yoursite.com/about.html">about</a> | <a href="http://www.yousite.com/archives.html">archives</a> | <a href="http://www.yoursite.com/contact">contact</a> | <a href="http://www.yoursite.com/index.xml">rss</a>
</div>
In my navbar tempalte I'd need three or more sections of code like that, a section for each template I want to call it into...
CODE
If template = Main Index
<div id="nav">
<a href="http://www.yoursite.com/about.html">about</a> | <a href="http://www.yousite.com/archives.html">archives</a> | <a href="http://www.yoursite.com/contact">contact</a> | <a href="http://www.yoursite.com/index.xml">rss</a>
</div>
If template = Master Archive Index
<div id="nav">
<a href="http://www.yoursite.com/about.html">about</a> | <a href="http://www.yoursite.com/contact">contact</a> | <a href="http://www.yoursite.com/index.xml">rss</a>
</div>
If template = About page
etc...
<div id="nav">
<a href="http://www.yoursite.com/about.html">about</a> | <a href="http://www.yousite.com/archives.html">archives</a> | <a href="http://www.yoursite.com/contact">contact</a> | <a href="http://www.yoursite.com/index.xml">rss</a>
</div>
If template = Master Archive Index
<div id="nav">
<a href="http://www.yoursite.com/about.html">about</a> | <a href="http://www.yoursite.com/contact">contact</a> | <a href="http://www.yoursite.com/index.xml">rss</a>
</div>
If template = About page
etc...
What kind of code do I need to do the conditional stuff, where it pulls the correct navbar code for the right template?