Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Displayin "Add a Link" based on category depth?

Quote Reply
Displayin "Add a Link" based on category depth?
The way the submission process is set up, it allows a surfer to submit a site under a main category, even though it belongs in a subcategory if that's where they are when they click Add a Link.

Problem is with the "Add A Link" at the bottom of every page the newbies don't know how to drill down to the subcategory, and there's no instructions for them to locate the correct subcategory prior to clicking on the add a link. Editors (unless they are really watching) just validate the link where it's at, and either don't realize where it will display when the directory regenerates the pages, or don't think to move it after validation to the appropriate sub category.

Solution would be to remove the add a link from the screen if the category depth is 0 or 1 and have it appear on only pages with a depth of 2 or greater ,that would just offer it on category pages that you want to see submissions in - it will also simplify the editors work, as then the new listings are pretty much categorized when received.

But, does anyone know a way that this can be accomplished?

Thanks in advance.

Quote Reply
Re: [Demolitioncrew] Displayin "Add a Link" based on category depth? In reply to
How deep would you want it to be? Just one where their is no father ID set? (i.e non-root ones) ???

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: [Demolitioncrew] Displayin "Add a Link" based on category depth? In reply to
Hi,

This is a manual solution, but I've done this by adding a new ENUM field to the Category table called isSub [Yes/No] (default 'Yes').

Then in the category template I just put a condition around the 'Add a Site' link:

Code:
<%if isSub eq 'Yes'%>
Display add a site link
<%endif%>

This allows me to turn site suggestions on/off on an individual category basis, in my case I've turned it off for the top-level categories and for selected lower level ones where I want people to go deeper before submitting.

If you've already got a large category structure in place you could push 'Yes' into all the categories and then turn off selected ones at will, however this is a manual solution and I suppose an automated one would improve it from a maintenance p.o.v.

Anyway, hope this helps Smile

All the best
Shaun
Quote Reply
Re: [qango] Displayin "Add a Link" based on category depth? In reply to
Thanks Everyone.

Shaun, that solution worked great for me. I appreciate the advice!
Quote Reply
Re: [qango] Displayin "Add a Link" based on category depth? In reply to
Where do I have exactly to put this code?????????

<%if isSub eq 'Yes'%>
Display add a site link
<%endif%>

Thanks

Andrea
Quote Reply
Re: [Andreaf] Displayin "Add a Link" based on category depth? In reply to
I added the isSub field to the table category and I can't figure out how to see this field when adding or editing categories. Which template do I need to modify?

thanks.
Quote Reply
Re: [tariqali] Displayin "Add a Link" based on category depth? In reply to
It should show up automatically if you added it within the Links admin. If you added it in mysqlman then you will need to go into Category->properties and resync the database.