[Jifty-commit] r6383 - in jifty/trunk: .
Jifty commits
jifty-commit at lists.jifty.org
Fri Feb 20 19:25:13 EST 2009
Author: sartak
Date: Fri Feb 20 19:25:12 2009
New Revision: 6383
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Manual/Tutorial.pod
Log:
r80328 at onn: sartak | 2009-02-20 19:25:07 -0500
mason menu -> dispatcher menu
Modified: jifty/trunk/lib/Jifty/Manual/Tutorial.pod
==============================================================================
--- jifty/trunk/lib/Jifty/Manual/Tutorial.pod (original)
+++ jifty/trunk/lib/Jifty/Manual/Tutorial.pod Fri Feb 20 19:25:12 2009
@@ -421,30 +421,20 @@
annoying. To get a B<Post> button in the menu, you need to override the default
menus.
-Jifty's I<default> menus live in F<_elements/nav> in the default application
-template (along with the Pony). For now, override F<_elements/nav>. (We're
-working on ways to make this better.)
-
-Inside your applications F<share/web/templates> directory, create a directory called
-F<_elements>.
-
- mkdir share/web/templates/_elements
-
-You may want to start with the stock jifty template, in which case you
-only need to add the C<< $top->child( Post... >> part
-
- cat $(perl -MJifty::Util -e 'print Jifty::Util->share_root' \
- )/web/templates/_elements/nav > share/web/templates/_elements/nav
-
-Otherwise, inside F<_elements>, open up a new file called C<nav> in your
-text editor and insert:
-
- <%init>
- my $top = Jifty->web->navigation;
- $top->child( Home => url => "/");
- $top->child( Post => url => "/post",
- label => "Post Article");
- </%init>
+Open up a new file called F<lib/MyWeblog/Dispatcher.pm> and stick this into it:
+
+ package MyWeblog::Dispatcher;
+ use strict;
+ use warnings;
+ use Jifty::Dispatcher -base;
+
+ before '*' => run {
+ my $top = Jifty->web->navigation;
+ $top->child(Home => url => '/');
+ $top->child(Post => url => '/post', label => 'Post Article');
+ };
+
+ 1;
For more information about the menu system, see the documentation in
L<Jifty::Web::Menu>.
More information about the Jifty-commit
mailing list