On Fri, Jan 8, 2010 at 11:08 AM, Mohit Sindhwani <t...@onghu.com> wrote:
> On 9/1/2010 12:00 AM, Erik Ostrom wrote: > > Radiant already contains methods for constructing its URLs, so I think > > you can use this: > > > > tag 'local:edit_url' do |tag| > > edit_admin_page_path(tag.locals.page) > > end > Actually, those helpers (for routes) are not available in the models. I don't know which module you'd need to include to do that, but it would not work out of the box. > > > > You might want to show this link only to people who are logged in as > > admins. One way to do this is a separate tag: > > > > tag 'local:if_logged_in' do |tag| > > tag.expand if logged_in? > > end > > > > That'll let you write Radius code like this: > > > > <r:local:if_logged_in> > > <a href="<r:local:edit_url/>">edit</a> > > </r:local:if_logged_in> > > > > (All these code samples are untested, but, uh, they should be pretty > > close!) > > > That's cool - I learn something new all the time :) > > But this would require that you turn off page caching. If you attempt it, be sure to have a simple site structure and plenty of resources behind the application. -Jim -- Jim Gay http://www.saturnflyer.com _______________________________________________ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant