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

Trying to hide certain links in the link.html template

Quote Reply
Trying to hide certain links in the link.html template
Hi again,

I'm trying to hide certain link listings in the link.html template and thought I'd try by using something simple like this:


<%if listingstatus = Off><!--<%endif%>

link.html template body content goes in here

<%if listingstatus = Off%>--><%endif%>


However, while this works fine to make a link hide in the listing of links, when wanting to modify the link using modify.cgi, apparently it uses the link.html template code as well so the person can't see their listing to choose it to edit it.

Is there another simple way of hiding certain links (by user choice, not admin panel) that others are using?

Thanks,
Quote Reply
Re: [Westin] Trying to hide certain links in the link.html template In reply to
Hi,

I can't remember exactly, but try doing a <%GT::Template::dump%> on the modify.html template, and look for "modify.cgi". If a tag has that (I think its this_script, or something like that), then you can add that into your condition (so it will show, only when on modify.cgi)

Hope that helps

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] Trying to hide certain links in the link.html template In reply to
I suppose you can set it up, so that if the link owner is logged in, than they can view the listings on 'modify' and other pages that are used only by link owner and if end users is surfing, content won't be visible to them.

----------------------------------------------

Hi Andy,

I have tried setting up a condition and it seemed to work fine, however there seems to be another problem to working on this.

1. Once the listing is made to disappear (for example creating a new link property on/off). It will show empty space on category.html and then I tried updating sorting order. So for example if there were 200 listings in one category, it will sort based on on and off. Now if there are about 15 listings set to off, then last 1.5 half pages will appear, but they are empty.

Now is there any way/global. So if the listing meets admin specified condition, it will not be published at all.

for example: via cron job, admin can easily setup deadlink check. Now it would be wonderful to see that if the link (all dead links have specific code given by glinks) is dead - it won't be published and if it is already having an existing page, than it will be automatically removed from category display and pagination will show normal count (without the dead links) in total, after the next rebuild.

Thank you again.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Trying to hide certain links in the link.html template In reply to
Hi,

I'm afraid you won't be able to actually "exclude" links from the category page, because they are all loaded via the core codes. What you would have to do, is actually edit all the places where it gets the links, and add the conditions in.

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] Trying to hide certain links in the link.html template In reply to
how about setting up a cron job. So if:

1:00 AM - GLinks is set to auto check for dead/error links.
2:00 AM - Cron job sets all error (I think error links are all those not having status code 200, 301 & 302) links to 'Not Validated' in GLinks db
2:30 AM - Cron job rebuilds all changed listed

If this is possible, than it would fix the problem for me, westin and any one else trying to setup such function.

What do you think?

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Trying to hide certain links in the link.html template In reply to
The only problem with that, is they would then show up again on the "Validate Links" page ;)

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] Trying to hide certain links in the link.html template In reply to
Then how about editing link property and changing the 'Status' hidden option from Links Property. Adding new option .. e.g error listings - Yes/No
So while cron is running, it will not only change Validation to No, but will Change Error Listing to Yes mode. So this will give admin an idea on why the listing is still in validation mode.

In addition, GLinks function tracks the history of error links. So if admin reviews listings even once a month, long term error listings can be removed easily and still one can have error free directory and display.

Any thoughts?

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Trying to hide certain links in the link.html template In reply to
Ya, guess that could be done - but not something I'd wanna do (especially for free), as I'm far to bogged down with other project ATM, sorry.

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] Trying to hide certain links in the link.html template In reply to
Andy wrote:
Hi,

I can't remember exactly, but try doing a <%GT::Template::dump%> on the modify.html template, and look for "modify.cgi". If a tag has that (I think its this_script, or something like that), then you can add that into your condition (so it will show, only when on modify.cgi)

Hope that helps

Cheers


The only instance of modify.cgi on the modify.html template when I add <%GT::Template::dump%> to the modify.html template was this:
Code:

main_title_loop[
{
'Name' => 'Home',
'URL' => 'http://www.domain12.com/decks/'
},
{
'Name' => 'Modify a Link',
'URL' => 'http://www.domain12.com/modify.cgi?LinkID=34'
}
];


So would I be trying to add <%main_title_loop%> as a condition somehow?
Something like:
<%if not main_title_loop%>
<%if listingstatus = Off%><!--<%endif%>

link.html template body content goes in here

<%if listingstatus = Off%>--><%endif%>
<%endif%>

// We don't use any URL's in our system as it's not really a links system anymore but rather a collectible card game database where people enter their card decks and cards for sale to buy etc. So we can't do any checking of the URL field since it's always just http://

Last edited by:

Westin: May 10, 2009, 6:51 PM
Quote Reply
Re: [Westin] Trying to hide certain links in the link.html template In reply to
Hi,

Erm, really? You don't get ANYTHING else with the GT::Template::dump? I find that hard to believe :/

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: [Westin] Trying to hide certain links in the link.html template In reply to
I think you probably want to use the page_id tag. Look at the various values in the dump.

Adrian
Quote Reply
Re: [brewt] Trying to hide certain links in the link.html template In reply to
Found the page_id modify

Okay so, maybe something like

<%if page_id ne modify%>
<%if listingstatus = Off%><!--<%endif%>

link.html template body content goes in here

<%if listingstatus = Off%>--><%endif%>
<%endif%>

Last edited by:

Westin: May 10, 2009, 11:57 PM
Quote Reply
Re: [Westin] Trying to hide certain links in the link.html template In reply to
Ya, should work - but you'd need something like:

<%if page_id ne "modify"%>

i.e quoting "modify" ;)

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: [Westin] Trying to hide certain links in the link.html template In reply to
Hi Westin,

So if I understand correctly all what you want to do is hide a listings from public view, but allow the listings owner to modify it. And seems like you are only having problem with Link Owners ability to modify the listings. Right?

Code:
<%if LinkOwner eq $Username%>
Normal Link.html or modify.html code here for Link Owner to see.

<%else%>
<%if listingstatus = Off%> <%else%>
link.html template body content goes in here
<%endif%>

<%endif%>


See if this helps.

Vishal
-------------------------------------------------------