Matt,
Thanks for the advice.
Just to get it to work, I something something similar:
<extend tag="main-nav">
<navigation class="main-nav" merge-attrs param="default">
<if test="¤t_user.is_an_administrator?"><old-main-nav merge/></if>
<else>
<nav-item href="#{base_url}/">Home</nav-item>
<nav-item with="&Club">Clubs</nav-item>
<nav-item with="&League">Leagues</nav-item>
</else>
</navigation>
</extend>
That is, the administrator gets the automatically generated menu, but the full
menu is hand coded for everyone else.
Regards,
Henry
On August 14, 2009 02:47:40 pm Matt Jones wrote:
> I wouldn't worry about it - the generated main-nav tag (as you can
> see) doesn't really do anything spectacular or complicated. Just copy
> the definition into your application.dryml and modify it as much as
> you want.
>
> I'm thinking this could make a good little recipe for the cookbook -
> "When to stop tweaking the generated code and just write your own"...
>
> --Matt Jones
>
> On Aug 14, 2009, at 2:36 PM, Henry Baragar wrote:
> > Hello,
> >
> > I have failed the exercise...
> >
> > In app/views/taglibs/auto/rapid/pages.dryml, I have:
> >
> > <def tag="main-nav">
> > <navigation class="main-nav" merge-attrs param="default">
> > <nav-item href="#{base_url}/">Home</nav-item>
> > <nav-item with="&Club">Clubs</nav-item>
> > <nav-item with="&League">Leagues</nav-item>
> > <nav-item with="&Organizer">Organizers</nav-item>
> > </navigation>
> > </def>
> >
> > In app/views/taglibs/application.dryml, I am trying:
> >
> > <extend tag="main-nav">
> > <navigation class="main-nav" merge-attrs param="default">
> > <if test="¤t_user.is_an_administrator?"><old-main-nav merge/
> >
> > ></if>
> >
> > <else><old-main-name merge without-nav-item-??? /></else>
> > </navigation>
> > </extend>
> >
> > What do I replace the "???" to select the "Organizers" tab?
> >
> > Regards,
> > Henry
> >
> > On August 4, 2009 09:19:18 am Betelgeuse wrote:
> >> On Aug 4, 4:57 am, Dave Porter <[email protected]> wrote:
> >>> Thanks Brett - works a treat !
> >>> Dave
> >>
> >> Copying means having to manually update it when you add new models.
> >> Here's a way to change cards based on a condition. The same logic
> >> can be adapted for the main navigation (left as an exercise to the
> >> reader):
> >>
> >> <extend tag="card" for="User">
> >> <if test="&this != current_user">
> >> <old-card merge without-count/>
> >> </if>
> >> <else>
> >> <old-card merge/>
> >> </else>
> >> </extend>
> >
> > Henry Baragar
> > Instantiated Software
> > 416-907-8454 x42
>
>
--
Henry Baragar
Instantiated Software
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---