| App-ZofCMS-Plugin-NavMaker documentation | view source | Contained in the App-ZofCMS-Plugin-NavMaker distribution. |
App::ZofCMS::Plugin::NavMaker - ZofCMS plugin for making navigation bars
In your Main Config File or ZofCMS Template:
nav_maker => [
qw/Foo Bar Baz/,
[ qw(Home /home) ],
[ qw(Music /music) ],
[ qw(foo /foo-bar-baz), 'This is the title=""', 'this_is_id' ],
],
plugins => [ qw/NavMaker/ ],
In your HTML::Template template:
<tmpl_var name="nav_maker">
Produces this code:
<ul id="nav">
<li id="nav_foo"><a href="/foo" title="Visit Foo">Foo</a></li>
<li id="nav_bar"><a href="/bar" title="Visit Bar">Bar</a></li>
<li id="nav_baz"><a href="/baz" title="Visit Baz">Baz</a></li>
<li id="nav_home"><a href="/home" title="Visit Home">Home</a></li>
<li id="nav_music"><a href="/music" title="Visit Music">Music</a></li>
<li id="this_is_id"><a href="/foo-bar-baz" title="This is the title=""">foo</a></li>
</ul>
The plugin doesn't do much but after writing HTML code for hundreds of navigation bars I was fed up... and released this tiny plugin.
This documentation assumes you've read App::ZofCMS, App::ZofCMS::Config and App::ZofCMS::Template
pluginsplugins => [ qw/NavMaker/ ],
The obvious one is that you'd want to add NavMaker into the list of
your plugins.
nav_maker nav_maker => [ qw/Foo Bar Baz/ ],
# same as
nav_maker => [
[ 'Foo' ],
[ 'Bar' ],
[ 'Baz' ],
],
Mandatory. Specifies the text to use for the link.
nav_maker => [
[ Foo => '/foo' ],
],
Optional. Specifies the href="" attribute for the link. If not
specified will be calculated from the first element (the text for the link)
in the following way:
$text =~ s/[\W_]/-/g;
return lc "/$text";
nav_maker => [
[ 'Foo', '/foo', 'Title text' ],
],
Optional. Specifies the title="" attribute for the link. If not
specified the first element (the text for the link) will be used for the
title with word Visit prepended.
nav_maker => [
[ 'Foo', '/foo', 'Title text', 'id_of_the_li' ]
],
Optional. Specifies the id="" attribute for the <li> element
of this navigation bar item. If not specified will be calculated from the
first element (the text of the link) in the following way:
$text =~ s/\W/_/g;
return lc "nav_$text";
nav_makerZoffix Znet, <zoffix at cpan.org>
(http://zoffix.com, http://haslayout.net)
Please report any bugs or feature requests to bug-app-zofcms-plugin-navmaker at rt.cpan.org, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-ZofCMS-Plugin-NavMaker. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc App::ZofCMS::Plugin::NavMaker
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-ZofCMS-Plugin-NavMaker
Copyright 2008 Zoffix Znet, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| App-ZofCMS-Plugin-NavMaker documentation | view source | Contained in the App-ZofCMS-Plugin-NavMaker distribution. |