# Edit Links

**URL:** <https://www.ruby-forum.com/t/edit-links/65419>\
**Category:** Radiant CMS\
**Created:** [August 18, 2006, 2:45am UTC](https://www.ruby-forum.com/t/edit-links/65419 "2006-08-18T02:45:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Lyons](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df705f/32.png) [@Daniel\_Lyons](https://www.ruby-forum.com/u/Daniel_Lyons)\
**Post date:** [August 18, 2006, 2:45am UTC](https://www.ruby-forum.com/t/edit-links/65419/1 "2006-08-18T02:45:41Z")

</div>

Hi,

I’m wondering if there is a simple way to determine in a template  
whether or not the user is logged in as someone who can edit the  
current page, and if so, show a link to the edit page in the admin  
area. It strikes me as something someone may have wanted to do  
before, so I thought I’d ask here first.

Thanks,

---

<div class="post-metadata">

**Author:** ![Daniel\_Lyons](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df705f/32.png) [@Daniel\_Lyons](https://www.ruby-forum.com/u/Daniel_Lyons)\
**Post date:** [August 18, 2006, 3:48am UTC](https://www.ruby-forum.com/t/edit-links/65419/2 "2006-08-18T03:48:44Z")

</div>

Daniel Lyons wrote:

> I’m wondering if there is a simple way to determine in a template  
> whether or not the user is logged in as someone who can edit the current  
> page, and if so, show a link to the edit page in the admin area. It  
> strikes me as something someone may have wanted to do before, so I  
> thought I’d ask here first.

There is not. Currently this is because it would conflict with the way  
Radiant caches pages. It should be possible to create tags for this, but  
you would also need to turn caching off.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Daniel\_Lyons](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df705f/32.png) [@Daniel\_Lyons](https://www.ruby-forum.com/u/Daniel_Lyons)\
**Post date:** [August 18, 2006, 4:37am UTC](https://www.ruby-forum.com/t/edit-links/65419/3 "2006-08-18T04:37:16Z")

</div>

Daniel Lyons wrote:

> Interesting. I wonder if it would be possible to implement a caching  
> system that could take this into account.
> 
> Obviously, this isn’t a deal breaker. Back to hacking…

I’m considering adding fragment caching so that you could mark certain  
sections of the page for caching and let it generate the rest.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![Daniel\_Lyons](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df705f/32.png) [@Daniel\_Lyons](https://www.ruby-forum.com/u/Daniel_Lyons)\
**Post date:** [August 18, 2006, 4:46am UTC](https://www.ruby-forum.com/t/edit-links/65419/4 "2006-08-18T04:46:20Z")

</div>

On Aug 17, 2006, at 8:35 PM, John W. Long wrote:

> Daniel Lyons wrote:
> 
> > Interesting. I wonder if it would be possible to implement a caching  
> > system that could take this into account.
> > 
> > Obviously, this isn’t a deal breaker. Back to hacking…
> 
> I’m considering adding fragment caching so that you could mark certain  
> sections of the page for caching and let it generate the rest.

I believe, though I could be mistaken, that Typo implements this.

Incidentally, Radiant is a lot faster than Typo on my server in an  
analogous configuration, though they are solving different problems  
and at different levels of maturity.

–  
Daniel

---

<div class="post-metadata">

**Author:** ![Daniel\_Lyons](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df705f/32.png) [@Daniel\_Lyons](https://www.ruby-forum.com/u/Daniel_Lyons)\
**Post date:** [August 18, 2006, 4:12am UTC](https://www.ruby-forum.com/t/edit-links/65419/5 "2006-08-18T04:12:45Z")

</div>

On Aug 17, 2006, at 7:46 PM, John W. Long wrote:

> this, but  
> you would also need to turn caching off.

Interesting. I wonder if it would be possible to implement a caching  
system that could take this into account.

Obviously, this isn’t a deal breaker. Back to hacking…

–  
Daniel

---

<div class="post-metadata">

**Author:** ![Daniel\_Lyons](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df705f/32.png) [@Daniel\_Lyons](https://www.ruby-forum.com/u/Daniel_Lyons)\
**Post date:** [August 18, 2006, 8:51pm UTC](https://www.ruby-forum.com/t/edit-links/65419/6 "2006-08-18T20:51:14Z")

</div>

John,

+1 - Fragment caching would be great!

AEM

---

<div class="post-metadata">

**Author:** ![Daniel\_Lyons](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/df705f/32.png) [@Daniel\_Lyons](https://www.ruby-forum.com/u/Daniel_Lyons)\
**Post date:** [August 22, 2006, 5:23am UTC](https://www.ruby-forum.com/t/edit-links/65419/7 "2006-08-22T05:23:05Z")

</div>

Assuming that you don’t have any behaviors that would create a rails  
session, you could embed some javascript that checks for the session  
cookie and displays that link then - that would be cache-safe.

* * *

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Daniel Lyons  
Sent: Friday, 18 August 2006 10:45 AM  
To: removed\_email\_address@domain.invalid  
Subject: [Radiant] Edit Links

```
Hi,

I'm wondering if there is a simple way to determine in a

```

template whether or not the user is logged in as someone who can edit  
the current page, and if so, show a link to the edit page in the admin  
area. It strikes me as something someone may have wanted to do before,  
so I thought I’d ask here first.

```
Thanks,

--
Daniel Lyons
removed_email_address@domain.invalid

```
