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
>
> 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 :)

Cheers,
Mohit.
9/1/2010 | 12:08 AM.

_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to