> For example, I have customized the look-and-feel of the various show > pages in my app, but they all follow the same flow with only some > minor variations. So, I was able to easily extend the "show-page" tag: > > /view/taglibs/application.dryml > <extend tag="show-page" polymorphic> > <page merge-attrs> > <content: param> > <!-- content goes here --> > </content:> > </page> > </extend>
Yes, good idea. A couple of points: - When extending, you should give the 'merge' attribute, not 'merge- attrs', so that any parameters passed to your new tag are forwarded to <page> - As you're not calling <old-page>, you are not extending <show- page>, you are really redefining it. So it would be better to just do <def tag="show-page" polymorphic> > Now, let's say we have a "Widgets" model, which needs a little > customizing for the show-page. Should I make a new tag: > > /view/taglibs/application.dryml > <def tag="show-page" for="Product"> > <!-- customizing goes here --> > </def> You mean for="Widget", right? > Or should I create a new show.dryml page: > > /view/widgets/show.dryml > <show-page title="Widget"> > <!-- etc etc etc --> > </show-page> I would create the show.dryml file. That's the place people expect to look for the custom page. In general I would say you should only define a tag if either: - It will be called from more than one place, or - Some other page or tag is getting too big and you want to break part of it out to improve clarity Tom --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
