Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.4
About It:
Get it:
Rate it:
  • Helpful?
  • 3 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

cbs_navigation_menu

Description

This plugin allows to create a custom navigation menu based on Textpattern sections and/or full external URL’s. You can choose which sections you want to display in which order and style the current section differently.

Or, instead of sections you can specify full URL’s (starting with http://, ftp://, mailto: or any other prefix) and they will be linked “as is”.

You can also specify access keys for each menu entry.

Syntax

<txp:cbs_navigation_menu sections="a,b,c" titles="A,B,C" />

Attributes

Required

  • sections: Comma-separated list of sections or full URL’s you want to link in your navigation menu, in order, with no spaces before and after commas. For the homepage, specify ‘default’ as section name. Each entry is interpreted as a Textpattern section, unless it contains a ‘:’ character like in any full URL starting with ‘http://’, ‘ftp://’, ‘mailto:’, …
  • titles: Comma-separated list of titles you want to display for each section of the “sections” attribute above, with no spaces before and after commas.

Optional

  • accesskeys: Comma-separated list of keyboard access keys to associate with each section link of the “sections” attribute above, with no spaces before and after commas. If you don’t want to specify an access key for a section, leave it empty (’‘), but you must have the same number of commas as in the “sections” and “titles” attributes. Default is no access keys.
  • break: HTML tag to be used for line breaks, without brackets. Default is br.
  • wraptag: HTML tag to be used as the wraptag, without brackets. Default is empty.
  • class: CSS class attribute for wraptag, default is no class attribute.
  • activeclass: CSS class attribute to apply to links pointing to the current section, if any. Default is no class attribute.
  • activenolink: When set to true, the current section will not be linked, but wrapped with a <span> tag instead. The class of the “activeclass” attribute and the id of the “ids” attribute, if specified, will be applied to this <span> tag. Default is false.
  • ids: Comma-separated list of XHTML id attributes to apply to each menu item, with no spaces before and after commas. If you don’t want to add an id attribute for a section, leave it empty (’‘), but you must have the same number of commas as in the “sections” and “titles” attributes. Default is no id attribute.

Changes history

v0.4 (2006-09-25)

  • Added the “activenolink” attribute that allows to not link the current section.
  • Replaced the “firstid” attribute with the more flexible “ids” attribute that allows to set an optional id for each element of the menu.

v0.3 (2006-08-16)

  • Small bugfix: Now it is possible to specify “0” as accesskey.

v0.2 (2006-07-27)

  • Small bugfix: using br instead of <br /> as a default value for “break”.

v0.1 (2006-07-16)

Initial release.

Article Request Count:
Initially released:
2006-07-16
Posted here:
15 Jul 2006
Article modified:
20 Apr 2015

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (10)

A minor bug but still worth bringing up: You can not provide the value of zero (“0”) as an accesskey. Otherwise, great plug-in.
Thanks. I’ve fixed that in version 0.3 three weeks ago
Jo:
Would be a great plugin for me (exactly what I was looking for!) only I consistently get the following error: “Textpattern Warning: Unknown tag on line 911”. This only happens on second level archived pages, but on my main page the menu doesn’t output at all. I’m using the latest version of textpattern – any ideas?
Does this plugin only allow one instance (one menu) per page?
I’ve opened a thread on the forum to answer the questions.
Nice , I have not tried this one yet.
What would be most useful also , would be an option,
to not generate a link for the active section, but a
strong or span class instead, so the active link doesn’t link back to itself.

regards, marios
marios:
would it be possible to have an attribute, to get
the active section wrapped with span or strong
and strip the anchor tags ?

regards, marios

Ok, so this is going to be our new baby today.
I will integrate this into a port, that I am working on right now.

regards, marios

Laptophobo:

In the book: “Textpattern Solutions” they show this plugin as a horizontal nav bar, which is what I need. but the configuration seems to be only vertical. Is there a way to make it horizontal?

Looks really groovy to me. Playing with it now.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment or visit the forum discussion?

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern