Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Different search results template

Quote Reply
Different search results template
By default, search results are displayed using the search_results.html and link.html templates. But what if I wanted to add a second set of templates (example: search_results2.html and link2.html) to display the results differently? Is that possible?
Quote Reply
Re: [Katana Man] Different search results template In reply to
You would really need a new template set (you could just do the appropriate search templates, and not the resd). Create a new folder, in the /templates/ folder, say something like 'search2', and then upload the other templates to that folder. CHMOD it to 777, and the files within it to 666. Then whenever a search is run, you need to add this to the end of it;

&t=default2

This tells links SQL to use templates set 'default2'.

Hope that helps Smile

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] Different search results template In reply to
Thanks Andy, that could work. Seems like a bit of an overkill though just for 2 templates to work. I would need to maintain 2 complete sets of templates just to show different search results style.

Any other ideas?
Quote Reply
Re: [Katana Man] Different search results template In reply to
I suppose, another way, would be to pass another variable, i.e template_name, which is checked for in the seach templates. i.e.;

<%if search_template eq "temp1"%>
template stuff for 'temp1' design...
<%endif%>


<%if search_template eq "temp2"%>
template stuff for 'temp2' design...
<%endif%>

You will the need to add some hidden tags to pass this along to the other appropriate search templates...

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] Different search results template In reply to
Thanks Andy. I've already experimented with this. It requires a ton of if statements in the search_results.html and links.html files. It would work, but also not very efficient. It also prevents you from using a html program to edit the templates.

I'm really quite surprised that I'm the first in need of this solution. I can think of many practical uses for it: Printer friendly views, compressed summary vs. more details, larger fonts for visually impaired, table view, etc...
Quote Reply
Re: [Katana Man] Different search results template In reply to
In Reply To:
I'm really quite surprised that I'm the first in need of this solution. I can think of many practical uses for it: Printer friendly views, compressed summary vs. more details, larger fonts for visually impaired, table view, etc...

You can use my PageBuilder plugin to create all those additional link pages you want (you can also create additional category pages, with a list of links). Maybe the plugin would be something for you.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Different search results template In reply to
Hmm, yes, I do own that. I didn't even think to look to see if your plugin would do the trick. So how would I use the plugin allow me to toggle between the different search result views?

Last edited by:

Katana Man: Oct 22, 2002, 11:20 AM
Quote Reply
Re: [Katana Man] Different search results template In reply to
The search result can be handled by modifying your link.html template to

<%if query%>
[ how the link should look for search results ]
<%else%>
[ how the link should look by default ]
<%endif%>

I was referring to print pages, pages for the visually handicapped, when I said the plugin can be used to create those pages Wink

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Different search results template In reply to
Hallo Yogi,

actually I'm also thinking about a solution for my needs ....

I want to use a shopping-card. At the category listing, people see small images of the articles, at the detailed pages they will see a larger, more detailed picture.

My idea is ... at the detailed-page, users can click a link to see a XXL-image of the article. I don't want to use a popup-window to display the XXL-image. I would like that the detailed-page reload with the larger image.
I would need to have 2 different detailed-pages, because I need to change the design of the reloaded page.

You know what I mean?

Michael

--
Michael Skaide

http://www.cycle24.de

Quote Reply
Re: [Sir Up] Different search results template In reply to
Are you using static pages or dynamic pages?

If you are using dynamic pages, you can just pass along a key in your query string, and in the template display the things you want according to the value of the key in the query string.

I.e. you could make your links point to

page.cgi?Detailed/123.html;

for the normal detailed page, and for the one with the XXL image, you would use

page.cgi?Detailed/123.html;size=XXL

Then in the detailed.html template, you use something like

<%if size eq 'XXL'%>
....
<%else%>
....
<%endif%>


If you are using static pages, the easiest solution is the pagebuilder plugin, where you can just define a link page with a separate template (e.g. detailed_xxl) and then have the plugin build the pages where you want (e.g. Detailed/123-XXL.html).

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Different search results template In reply to
I tried, but I have an "undefined value"

Where to define "size" ??

Michael

--
Michael Skaide

http://www.cycle24.de