Re: [Radiant] link on front-end to edit this_page if logged in
On Fri, Jan 8, 2010 at 1:36 PM, Haselwanter Edmund wrote: > > On 08.01.2010, at 19:16, Jim Gay wrote: > > >>> > >>>tag 'local:if_logged_in' do |tag| > >>> tag.expand if logged_in? > >>>end > >>> > >>> That'll let you write Radius code like this: > >>> > >>> > >>> edit > >>> > >>> > >>> (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. > > what about using this on the "dev" host? is it possible to have caching > > on > > www.mysite.com > > but not on > > dev.mysite.com? > > this would allow for editing *and* viewing the unpublished pages > > cu edi > -- > DI Edmund Haselwanter, edm...@haselwanter.com, > http://edmund.haselwanter.com/ > > > That would be nice. I haven't worked on it, but I had been considering some addition to the r:content tag to optionally append a link for editing. That way you could more easily set it to automatically appear, rather than the need for a new tag. -- 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
Re: [Radiant] link on front-end to edit this_page if logged in
On 08.01.2010, at 19:16, Jim Gay wrote: >>> >>>tag 'local:if_logged_in' do |tag| >>> tag.expand if logged_in? >>>end >>> >>> That'll let you write Radius code like this: >>> >>> >>> edit >>> >>> >>> (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. what about using this on the "dev" host? is it possible to have caching on www.mysite.com but not on dev.mysite.com? this would allow for editing *and* viewing the unpublished pages cu edi -- DI Edmund Haselwanter, edm...@haselwanter.com, http://edmund.haselwanter.com/ ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] link on front-end to edit this_page if logged in
On Fri, Jan 8, 2010 at 11:08 AM, Mohit Sindhwani 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: > > > > > > edit > > > > > > (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
Re: [Radiant] link on front-end to edit this_page if logged in
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: > > > edit > > > (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
Re: [Radiant] link on front-end to edit this_page if logged in
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: edit (All these code samples are untested, but, uh, they should be pretty close!) --Erik Ostrom e...@echographia.com On Fri, Jan 8, 2010 at 12:39 AM, Mohit Sindhwani 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: Radiant@radiantcms.org > Search: http://radiantcms.org/mailing-list/search/ > Site: http://lists.radiantcms.org/mailman/listinfo/radiant > ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] link on front-end to edit this_page if logged in
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: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] link on front-end to edit this_page if logged in
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 Cheers, Mohit. 8/1/2010 | 4:37 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] link on front-end to edit this_page if logged in
Hi all, Am 07.01.2010 um 20:01 schrieb Steven Southard: > 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. full ACK. That as well as "previous/next page" links on the admin screen, which would help tremendously. Regards, Christian ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] link on front-end to edit this_page if logged in
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. On Jan 7, 2010, at 12:38 PM, Anton Aylward wrote: > Steven Southard said the following on 01/07/2010 01:31 PM: >> I've heard wordpress has this handy edit link on any page if logged >> in >> as admin. Sounds like an efficient way to encourage editing of >> pages. As I understand, on the front-end if admin I need a link to >> open /admin/pages/this_page/edit. Are the basic tools in place for >> me >> to do that? Is there an extension that would be helpful? > > That sounds like one step along the road to making Radiant into a Wiki > > > -- > What goes around comes around. > ___ > Radiant mailing list > Post: Radiant@radiantcms.org > Search: http://radiantcms.org/mailing-list/search/ > Site: http://lists.radiantcms.org/mailman/listinfo/radiant ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] link on front-end to edit this_page if logged in
Steven Southard said the following on 01/07/2010 01:31 PM: > I've heard wordpress has this handy edit link on any page if logged in > as admin. Sounds like an efficient way to encourage editing of > pages. As I understand, on the front-end if admin I need a link to > open /admin/pages/this_page/edit. Are the basic tools in place for me > to do that? Is there an extension that would be helpful? That sounds like one step along the road to making Radiant into a Wiki -- What goes around comes around. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
[Radiant] link on front-end to edit this_page if logged in
I've heard wordpress has this handy edit link on any page if logged in as admin. Sounds like an efficient way to encourage editing of pages. As I understand, on the front-end if admin I need a link to open /admin/pages/this_page/edit. Are the basic tools in place for me to do that? Is there an extension that would be helpful? Steven ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant