Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: Formatting Search Results

Quote Reply
Re: Formatting Search Results In reply to
1) In order to have the category diplayed under the link in your search results and NOT in your category pages, you will need to use a different template file.....

a) Copy your sub site_html_link in the HTML_Templates.pm file and call the new subroutine: sub site_html_search_link.

b) Then in this new subroutine, load searchlink.html NOT link.html.

c) Create a new template file called searchlink.html and upload it in your templates directory.

2) Then in your search.cgi, replace all occurrences of &site_html_link with &site_html_search_link.

3) Rem out (#) or delete the following line of code in the search.cgi file:

Code:

$link_results .= "
" . &search_build_linked_title ($name) . "
\n";


in the sub search routine.

4) Then in your sub site_html_search_link routine in the HTML_Templates.pm file, add the following codes:

Code:

# Print Category and link to Category

my $catname = &Links::DB_Utils::get_category_name($rec->{CategoryID});
my $category = &Links::DB_Utils::build_clean_name($catname);


Then define the following tags in this subroutine:

Code:

printcat => $catname,
Category => $category


5) Then in your searchlink.html file, add the following codes:

Code:

<a href="/<%Category%>/"><%printcat%></a>


Regards,

Eliot Lee

Subject Author Views Date
Thread Formatting Search Results rover 3321 Sep 23, 2000, 7:31 AM
Thread Re: Formatting Search Results
Stealth 3251 Sep 23, 2000, 9:12 AM
Thread Re: Formatting Search Results
rover 3243 Sep 23, 2000, 9:34 AM
Thread Re: Formatting Search Results
Stealth 3248 Sep 23, 2000, 10:01 AM
Thread Re: Formatting Search Results
jiliu 3191 Oct 11, 2000, 8:59 AM
Post Re: Formatting Search Results
Stealth 3186 Oct 11, 2000, 9:18 AM