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!)
--Erik Ostrom
[email protected]
On Fri, Jan 8, 2010 at 12:39 AM, Mohit Sindhwani <[email protected]> wrote:
> On 8/1/2010 4:37 PM, Mohit Sindhwani wrote:
> > On 8/1/2010 3:01 AM, Steven Southard wrote:
> >
> >> No I don't think so. Just a link to the admin page. It would just
> >> make it fast because you won't have to go to the admin and find the
> >> page you want to edit. If you have a lot of pages that can be a hassle.
> >>
> >>
> >>
> > I think creating a link to the page would be a relatively simple tag to
> > add..
> >
> > From what I see, the URL is something like this:
> > http://example.com/admin/pages/20/edit
> > so, basically http://example.com/admin/#{page.id}/edit
> >
> > It should be something like this (untested):
> >
> > tag 'local:edit_url' do |tag|
> > page = tag.locals.page
> > elink = "#{http://example.com/admin/#{page.id}/edit}"
> > end
> >
> >
>
> Actually, more like:
>
> tag 'local:edit_url' do |tag|
> page = tag.locals.page
> elink = "#{/admin/#{page.id}/edit}"
> end
>
> Cheers,
> Mohit.
> 8/1/2010 | 4:39 PM.
>
>
>
> _______________________________________________
> Radiant mailing list
> Post: [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site: http://lists.radiantcms.org/mailman/listinfo/radiant
>
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant