Hello,
[Although the following inolves HTML code, it seems like more of a
general question, so I sent it to this list.]
I have a block of navigation code in a large bunch of HTML pages
that needs to be edited occasionally. It's easy to put in a
placeholder on the pages and Update, but of course there's a catch.
I want the page being updated to not have a link, while the same
line in all other pages has the link code. Like so...
An example code block in full:
<p class="navbarmain">
<a href="../prefatory.html">Prefatory</a> /
<a href="../Then/then.html">Then</a> /
<a href="../Others/others.html">Others</a> /
</p>
...would become, only on the Prefatory page:
<p class="navbarmain">
<span class="here">Prefatory</span> /
<a href="../Then/then.html">Then</a> /
<a href="../Others/others.html">Others</a> /
</p>
I then use the CSS class "here" to style the current page name to
stand out within the line of navigation links on the rendered page.
While it's easy to insert the whole code block on all pages, I can't
quite see how to automagically turn the current page's link into the
span. It's kind of the opposite of using the #FILE# placeholder. I
suspect I need a bit of script to do this, and since it's a common
enough task, I was hoping someone had already worked it out and
would be willing to share.
I don't know how to solve this problem with BBEdit's templates (I've
never used them), but I'd make two suggestions -
1. Why both stopping it from being a link. As long as it doesn't
really look like a link, and clearly shows the location as being "the
current page", it makes little difference if the user can technically
click it, right?
2. You can then do the whole lot with CSS using a body ID, like this:
<body id="prefactorypage">
...
<p class="navbarmain">
<a href="../prefatory.html" id="prefactorylink">Prefatory</a> /
<a href="../Then/then.html" id="thenlink">Then</a> /
<a href="../Others/others.html" id="otherslink">Others</a> /
</p>
Then your CSS has:
#prefactorypage #prefactorylink, #thenpage #thenlink, #otherspage #otherslink {
color: #888;
text-decoration: none
}
For an example of this, see the Interarchy docs page:
<http://www.interarchy.com/documentation/8/index.html>
The page ID coordinates with the table of contents on the right edge
of the page to highlight the page you're on.
Enjoy,
Peter.
--
Check out Interarchy 8.1.1, just released, now with Amazon S3 support.
<http://www.stairways.com/> <http://download.stairways.com/>
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>