Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

Can different category use differnt link template?

Quote Reply
Can different category use differnt link template?
Does Links SQL allow different category use different link template? If yes, how to do?
I ask this question because the link under some categories on my web site have different link format.

Last edited by:

drname: Sep 10, 2002, 8:02 AM
Quote Reply
Re: [drname] Can different category use differnt link template? In reply to
Yes, you can do that. You can keep one template file "link.html" for the link, and inside it, you do something like
Code:
<%if Full_Name contains 'Your Special Category'%>
[ html of special link ]
<%else%>
[ html of normal link ]
<%endif%>

I hope this helps.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [drname] Can different category use differnt link template? In reply to
Hi,

In adition to what yogi said, there is also a Category_Template field, where you can put in a tempalte set to use for that category. For instance, if you put 'yahoo' in for a given category, then the category template, link template and subcategory template will all be pulled from the yahoo template set.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Can different category use differnt link template? In reply to
Thanks, Yoga and Alex. But I don't know what Alex say and how to get the result using his way.
Quote Reply
Re: [drname] Can different category use differnt link template? In reply to
In the ../templates directory, you have several different template sets. "default" is installed when you install links, and the 'av', 'yahoo' and 'snap' templates have to be installed separately (to cut download size).

If you create a new directory "this_category" , and insert "this_category" into your Category table, in the field Category_Template, then when links builds, or displays the subcategory list, a link, and I think the detailed page, it will use the templates in that directory, rather than the currently selected "default" set.

This way, you can give different categories different templates, without doing too much work.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Alex] Can different category use differnt link template? In reply to
How can this be applied to just the links on the "what's new" page? I have two types of link formats: The category links and the links listed on the "what's new" page. Is there a way to modify "links.html" to use a different format if the links are being displayed on the "what's new" page?

thanks!

marc
Quote Reply
Re: [hcom] Can different category use differnt link template? In reply to
Hi,

You can edit the new.html and instead of using a single tag <%link_results%>, you can use a loop:

<%loop link_results_loop%>
My new link named: <%Title%>, URL: <%URL%>
<%endloop%>

and format it however you like.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Can different category use differnt link template? In reply to
Alex,

For some reason when using a loop like you mentioned, it just builds a blank page without the links.

For reference, I'm using version 2.1.2

marc
Quote Reply
Re: [hcom] Can different category use differnt link template? In reply to
Are there any new links?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Can different category use differnt link template? In reply to
Yes, my new page contains the last seven days worth of new links. There's a ton of them there right now.

marc
Quote Reply
Re: [hcom] Can different category use differnt link template? In reply to
If you add the line:

<%if Username eq 'your user name'%>
<%GT::Template::dump%>
<%endif%>

Do you see all values in loop_link_results?? You should see all the links unformatted.

(you need to insert your username and log on to see this, I *DO NOT* recommend using the dump without some sort of restriction on who sees the output)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Can different category use differnt link template? In reply to
Hi,

That simply builds the template page without any of the links. It seems to be ignoring the link results tag altogether. Same as when I use the loop as Alex directed.

marc
Quote Reply
Re: [hcom] Can different category use differnt link template? In reply to
If you do not see the link variables in the dump, then something is *really* wrong.

link_results has to be passed back to be used, and so does loop_link_results.

What happens if you put both in your template? You should see at least one, but you *should* see the links twice.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [hcom] Can different category use differnt link template? In reply to
What is the output from calling <%GT::Template::dump%> ?

Quote:
That simply builds the template page without any of the links.

Right, all that tag does is show you the available tags ... could you post what you see?
Quote Reply
Re: [Paul] Can different category use differnt link template? In reply to
Hi,

None of the available tags are shown. All I get is the "New Links" page template. It's obviously ignoring that tag. The links are displayed normally, however when using <%link_results%>

One bit of info... the only additional mod I'm using is that I have a "Randomizer" value set for my links to build randomly. My build_sort_order_category is setup with this: isNew DESC,Randomizer

marc
Quote Reply
Re: [mb] Can different category use differnt link template? In reply to
If you really want us to help...please post the contents of GT::TEmplate::dump. You could be missing something important...which we may spot. Not everythig is as it seems Wink

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: [mb] Can different category use differnt link template? In reply to
Try removing the "if Username" and "endif" tags and then the output will show.

Last edited by:

Paul: Mar 31, 2003, 9:33 AM
Quote Reply
Re: [pugdog] Can different category use differnt link template? In reply to
Sorry to go so far back in the messages, but I don't really understand the
Category_Template field. I understand the concept, and just tried it for the first time.

In Reply To:
If you create a new directory "this_category" , and insert "this_category" into your Category table, in the field Category_Template, then when links builds, or displays the subcategory list, a link, and I think the detailed page, it will use the templates in that directory, rather than the currently selected "default" set.

This way, you can give different categories different templates, without doing too much work.[/quote]
Why doesn't Category_Template also take add.html, modify.html and the cooresponding success/failure/landing pages
from the specified template directory? THAT would make distinct categories very easy (I think).
Is the list of templates that get used from the Category_Template directory just: category, subcategory, link and detailed?

I do things differently and am wondering if I took the hard way. I use the code below for selecting different link templates
based on the category that the link is in. As for add/modify in different categories, that's a whole other story.
If add/modify were taken from Category_Template, it might have been way easier.


Code:
<!-- Repeatedly call include with Link_Template -->
<!-- Link_Template is a custom Category column -->
<%loop links_loop%>
<%link_template%>
<%include $Link_Template%>
<%endloop%>

I am just getting to detailed pages and I am trying to determin if I should be utilizing Category_Template field?
Any advise and some clarification to my new-found confusion would be great!

Thanks,
Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com
Quote Reply
Re: [rgbworld] Can different category use differnt link template? In reply to
In Reply To:
Is the list of templates that get used from the Category_Template directory just: category, subcategory, link and detailed?
That's right.

In Reply To:
Why doesn't Category_Template also take add.html, modify.html and the cooresponding success/failure/landing pages
from the specified template directory? THAT would make distinct categories very easy (I think).
Since by default, the template passes the category ID along to add.cgi, you could do this, except you would have to sort of force the template to be used. One way of doing it would be to write a plugin that hooked onto the add/modify, and using the ID, looked up what template should be used and set $IN->param(t => $template).

In Reply To:
I am just getting to detailed pages and I am trying to determin if I should be utilizing Category_Template field?
Well, there's many ways of doing it. It depends on if what's built in fits your needs. If not, you can easily add your own column and write a bit of code to handle it yourself. What don't you understand about the Category_Template field? I'll give an explanation about the field anyways:

As you know, setting the Category_Template will change the template set that will be used for the category, link and detailed templates. However, if you specify a template name (ie. not a template set), then that template will be only used for the category template instead of category.html and there will be no effect on the other templates. You can also specify a template theme (ie. template_name.template_theme_name) if you wish to just use a different style sheet for the category.

Adrian