ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Adding an "Edit this page" link to entries when a user is logged in

March 15, 2008 7:11pm

Subscribe [4]
  • #1 / Mar 15, 2008 7:11pm

    RoelVG

    10 posts

    The ability to add an “Edit this page” link to my templates that only shows up when a user is logged in would be *so* convenient. Would it be possible to generate a link that leads straight to the control panel and opens up the edit form for that entry? That would be great.

  • #2 / Mar 15, 2008 7:18pm

    Arun S.

    792 posts

    Sure…

    You would have to create a SAEF that would edit that entry.  I have something similar on my site.

    It’s a regular SAEF with some help from Solspace’s FormHelper plugin (http://www.solspace.com/software/detail/form_helper/c/plugins/)

  • #3 / Mar 15, 2008 7:27pm

    RoelVG

    10 posts

    That plugin sure looks interesting, but it’s more than I need, really. I don’t want to recreate my forms, but just get a direct link to the ‘edit entry’ page in the control panel. Any ideas?

    Thanks!

  • #4 / Mar 15, 2008 7:45pm

    Eric Barstad

    198 posts

    This is probably from the wiki or kb, but this is what use:

    {if member_group=='1'}
    <a href="/system/index.php?C=edit&M=edit_entry&weblog_id={weblog_id}&entry_id={entry_id}">Edit</a>
    {/if}
  • #5 / Mar 15, 2008 7:50pm

    RoelVG

    10 posts

    Thanks, Eric! Works perfectly.

  • #6 / Mar 16, 2008 4:34pm

    Eric Barstad

    198 posts

    I’ve actually started putting this code in the path.php file and creating a variable that I can then just put in the template, e.g., {edit_entry}. Works pretty well.

  • #7 / Dec 15, 2008 1:21pm

    g0t035

    45 posts

    This is probably from the wiki or kb, but this is what use:

    {if member_group=='1'}
    <a href="/system/index.php?C=edit&M=edit_entry&weblog_id={weblog_id}&entry_id={entry_id}">Edit</a>
    {/if}

    The above code contains errors.

    weblog;_id and entry;_id should be weblog_id and entry_id

    But thanks for the code!

  • #8 / Dec 15, 2008 1:27pm

    Eric Barstad

    198 posts

    I think the forum added the “;” because when I try to fix it, the changes won’t save. Thanks for pointing it out, though.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases