Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Edit links directly from Detailed pages.

Quote Reply
Edit links directly from Detailed pages.
Here's a good tip which will allow you to edit your listings directly from the detailed pages, rather than having to search for them in the browser.

  • First create a global to display category numbers in Detailed pages (thank to Andy for this from another thread):

    Tag:
    Code:
    get_cat_id


    Global:
    Code:
    sub {
    return $DB->table('CatLinks')->select ( ['CategoryID'], { LinkID => $_[0] } )->fetchrow;
    }

  • Next add the following anywhere you like in Build > User Templates > detailed.html:

    Code:
    <a href="<%config.db_cgi_url%>/browser.cgi?action=link_modify_form&category_id=<%get_cat_id($ID)%>&link_id=<%ID%>" target="_blank">[Edit This Link]</a>

  • Now go to Database and in the Editor box select Users / Modify and click Go.

  • Put your username in the in the Username field and click Search.

  • In the results box change your status from Registered to Administrator.

  • Now go to Browse and expand Home. Click on the first category listed. When you list appears click Editors in the top box.

  • Add yourself as an editor here and click Add Editor.

That's it. Now when you are logged in and you view a detailed page you will be able to click on [Edit This Link] and it will open the database details for that link.

Last edited by:

MJB: Feb 13, 2011, 5:31 AM
Quote Reply
Re: [MJB] Edit links directly from Detailed pages. In reply to
Hi,

Thanks for sharing :)

Probably better (if using dynamic/mod_rewrite pages), to do it like this - so only the admin see's this link:

Code:
<%if user.Status eq "Administrator"%>
<a href="<%config.db_cgi_url%>/browser.cgi?action=link_modify_form&category_id=<%get_cat_id($ID)%>&link_id=<%ID%>" target="_blank">[Edit This Link]</a>
<%endif%>

Obviously that will only work in dynamic pages though Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit links directly from Detailed pages. In reply to
That was the first route I tried but <%if user.Status eq "Administrator"%> didn't work on the Detailed pages for some reason.
Quote Reply
Re: [MJB] Edit links directly from Detailed pages. In reply to
On statically built pages? (i.e using "Build All"), or with mod_rewrite?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Edit links directly from Detailed pages. In reply to
mod_rewrite. I added it to the header and it displayed on every page but Detailed so reverted back to the code above which works fine.

If it ain't broke......
Quote Reply
Re: [MJB] Edit links directly from Detailed pages. In reply to
The reason I selected 'Administrator' is that you only have to enable Editors for a single category to allow global editing.

If I left it as 'Registered' you would have to enable Editors for every category for the username.

I can't find anywhere in the browser to enable 'Global Editor'.
Quote Reply
Re: [MJB] Edit links directly from Detailed pages. In reply to
MJB wrote:
The reason I selected 'Administrator' is that you only have to enable Editors for a single category to allow global editing.

If I left it as 'Registered' you would have to enable Editors for every category for the username.

I can't find anywhere in the browser to enable 'Global Editor'.

Yeah, thats normal Smile

I actually wrote a plugin a while back, which lets you assign users to multiple categories much easier:

http://www.ultranerds.com/...n/QuickEditors_L194/

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!