Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[plugin] [ORPHAN] ako_nav v0.1
This is my first plugin, something not all that tricky, but in my opinion, quite useful.
Basically, it builds a nav bar with a few arguments. It also dynamically adds <code>class=“active”</code> to the a tag, dependant on what page it is.
I’m going to get some more documentation up within the next day, but for now you can just look at what is provided in the actual plugin.
Last edited by akokskis (2005-10-09 23:09:34)
Offline
Re: [plugin] [ORPHAN] ako_nav v0.1
had to add
<pre><?php
$plugin=’ </pre>
at the beginning and
<pre>=’
?></pre>
at the end of your downloadable txt file to be able to import it.
For those interested, the help infos then read as follows:
ako_nav Help File
A dynamic portable navigation creator
What does it do?
- Creates a primary div
- Inside the div, a heading is added for the Nav bar.
- Creates a ul to hold the nav bar.
- Goes through given urls and names of pages and dynmically adds them as li’s
- class=“active” is automatically added to the current page’s li.
Examples
The simplest form is this:
<pre> <txp:ako_nav name=“home,about,contact” url=”/,/about,/contact” />
</pre>
it will produce something like this:
<pre>
<div>
<h2>Navigation</h2>
<ul>
<li><a href=”/”>home</a></li>
<li><a href=”/about”>about</a></li>
<li><a href=”/contact”>contact</a></li>
</ul>
</div>
</pre>
Add some of the tags below to get a lot more creative.
Tags
Required- name – This is a list of page names, delimited by commas (and no spaces)
- url – This is a list of page url’s, following the same order as the page names, and also delimited by commas (and no spaces)
- title – This is the title attribute for the a tag.
- divid – This is an id for the div container.
- headid – This is an id for the header tag.
- ulid – This is an id for the ul tag.
- divclass – This is a class for the div container.
- headclass – This is a class for the header tag.
- ulclass – This is a class for the ultag.
- headtx – This is the text inside the header its self. By default, this is “Navigation
Last edited by jakob (2005-02-13 10:20:18)
TXP Builders – finely-crafted code, design and txp
Offline
Re: [plugin] [ORPHAN] ako_nav v0.1
akokskis – This is great. Something I’ve been thinking of doing. One thing that would be great is if you could turn off the header text.
Otherwise, this will be a great help.
By the way, the plugin installs fine. You just have to paste the code into the box on the plugin screen in RC1 or later.
Last edited by wilshire (2005-02-13 22:03:17)
Offline
Re: [plugin] [ORPHAN] ako_nav v0.1
Nice one this looks great. With a little styling it looks like alot can be done with this. Thanks for the contribution!
Jamie
Offline
Re: [plugin] [ORPHAN] ako_nav v0.1
Thanks for the comments so far guys. I appreciate it.
To the suggestion of wilshire, I’ve added an attribute to be able to turn off the header text – headon. This takes either a 0 (its off) or a 1 (its on). By default, this is on.
Any other comments / suggestions / [anything] ?
Last edited by akokskis (2005-10-09 23:09:59)
Offline
#6 2005-03-25 16:27:43
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: [plugin] [ORPHAN] ako_nav v0.1
Anyone got a copy of this I could have to install, it’s gone missing on Adrian’s site and Adrian is away.
leeaston @ gmail.com
Thanks
Lee
Offline
Re: [plugin] [ORPHAN] ako_nav v0.1
Um, it’s not missing on my site. Here’s the link
Last edited by akokskis (2005-10-09 23:10:13)
Offline
#8 2005-03-25 17:19:22
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: [plugin] [ORPHAN] ako_nav v0.1
Thanks, it must be Friday.
Offline
Re: [plugin] [ORPHAN] ako_nav v0.1
Heh, sure is…
No problem.
Offline
#10 2005-03-26 02:11:04
- rbl
- Member
- From: Portugal
- Registered: 2004-02-25
- Posts: 40
Re: [plugin] [ORPHAN] ako_nav v0.1
Akokskis, thanks for the plugin! =)
Offline
#11 2005-04-03 02:37:06
- icubyx
- Member
- From: India
- Registered: 2004-12-16
- Posts: 21
Re: [plugin] [ORPHAN] ako_nav v0.1
hi, I tried using this plugin with RC1 installed in the ‘txp’ subdirectory, but without success.
The code looks like this:
<txp:ako_nav name=“home,about,article” url=”/txp,/txp/about,/txp/article” />
However, only the ‘home’always remains highlighted no matter where I navigate to. Is there something I am doing wrong?
only change is constant
Offline
#12 2005-04-03 02:37:12
- icubyx
- Member
- From: India
- Registered: 2004-12-16
- Posts: 21
Re: [plugin] [ORPHAN] ako_nav v0.1
hi, I tried using this plugin with RC1 installed in the ‘txp’ subdirectory, but without success.
The code looks like this:
<txp:ako_nav name=“home,about,article” url=”/txp,/txp/about,/txp/article” />
However, only the ‘home’always remains highlighted no matter where I navigate to. Is there something I am doing wrong?
only change is constant
Offline