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

Search Results Custom Template

Quote Reply
Search Results Custom Template
Greetings:

Is it possible via a Global or Plugin to have a different search results template dependent upon the Search Results?

I have some 'set' search terms as Menu items. I would like a special template to display for each of these terms, that way I can customise each template.

I have the PageBuilder plugin, however it does not span multiple pages, so that isn't really an option.

Anyone got any ideas?


Thanks,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] Search Results Custom Template In reply to
Hi Clint

If you want the complete search results page different for each search you can try using the dynamic_preserve option of “t” which is for the template i.e. “t=template1” “t=template2” in your search string.
You will need to set up new template folders with link and search results template in them.

<form action="<%db_cgi_url%>/search.cgi" method="GET">
<input type="hidden" name="t" value="template1">

Or something like:

/search.cgi?query=search&t=template1&pps=Yes&bool=and&substring=0&mh=10&Submit=Search

If you want just the link display to be different do a template dump and see what variables are available and you may be able to use a <%if%> statement in there with <%if pps=’Yes’%>link1.html<%elseif =’isPick=Yes%>link2<%endif%>

Another option might be to use a hidden variable depending on which way you are going to set it up.

Regards

minesite
Quote Reply
Re: [Clint] Search Results Custom Template In reply to
Clint,

Not using it myself but have you looked at the SearchFilter plugin? Sounds a bit like what you're trying to do.

Quote:
SearchFilter
Author: yogi
Last Updated: 2002-07-31
Description:
This plugin allows you to display a custom page for certain words in a search query.

Safe swoops
Sangiro
Quote Reply
Re: [Clint] Search Results Custom Template In reply to
I am also looking for a template for search results and I found this thread.

Anyway, I tried search.cgi?query=*&catid=11&t=category_search_results&sb=Add_Date&so=DESC

But get the following error msg:

A fatal error has occured:

GT::Template::Inheritance (55408): Wrong argument passed to this subroutine. Usage: Path /hsphere/local/home/pocketdo/pocketdownload.com/v5/admin/templates/category_search_results does not exist or is not a directory at /hsphere/local/home/pocketdo/pocketdownload.com/v5/admin/GT/Config.pm line 374.

Please enable debugging in setup for more details.

I have created the template category_search_results.html from the admin area.

Help

Gavin
Quote Reply
Re: [fatcatz] Search Results Custom Template In reply to
t=TEMPLATE_SET_NAME
p=PAGE_TEMPLATE_NAME

However, I don't believe you can override the p= on a search. You're best bet, is to make a new template set (or a copy), and then you can use something like;

search.cgi?query=*&catid=11;sb=Add_Date&so=DESC;t=new_template_set_name

To make a new template set, the best bet is to log in via SSH/Telnet, and type;

Code:
cd /path/to/your/admin/folder
cd ./templates
mkdir new_set_name
cd default
cp * ../new_set_name/


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: [Clint] Search Results Custom Template In reply to
Thanks Andy Smile You're right about can't overriding the p=..., I'll try creating a new template as you suggested.

Thanks again

Gavin
Quote Reply
Re: [Andy] Search Results Custom Template In reply to
Hi Andy:

Thanks for the tip. So, if I were to want a special search template for eg. search term 'pps' then I would create a directory 'under' the "templates" directory called pps? If I was only interested in the search results being different then I could name this particular template "search_results.html". Am I on the right track here?


Thanks,



Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] Search Results Custom Template In reply to
Quote:
If I was only interested in the search results being different then I could name this particular template "search_results.html". Am I on the right track here?

Exactly! We are going to start working like this with our Plugins (i.e Add_Spider installs the templates into a new template set, called 'addspider'). This will hopefully make our plugins a bit cleaner on install, and even easier to customize :)

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] Search Results Custom Template In reply to
Hi

Is it possible to use globals with a new template set?

I created a new template set for a customised search results page but can't seem to call any globals.

I'm gettting "Unknown Tag" errors. Is there anyway around this?

Cheers.
Quote Reply
Re: [phuketkit] Search Results Custom Template In reply to
If you're using a new template set it will be looking for the globals in the new template set. I think that you need to inherit from your other template set (search for 'inherit' in the forum to see how to do this).
Quote Reply
Re: [afinlr] Search Results Custom Template In reply to
There are issues with inheretance. If this is a new template set, it's often easier to just copy your globals.txt file to the new template set. Just remember to edit all globals.txt files if you add/change the globals.

I tried using inheretance as it seemed to work, but ended up working around most of it.

if using a .tplinfo file doesn't help. copying the globals.txt file should.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.