Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Search results customization

Quote Reply
Search results customization
Hello!

I would like to customize search results (Links SQL 2.1).

I can't add picture in front of category matches. Also would be great to apply some CSS to category links :)

Everything is fine with link matches (link.html template), only category link drives me crazy.

Thanks
Quote Reply
Re: [Payooo] Search results customization In reply to
In search_results.html try adding this instead of the <%if links%><%links%><%endif%> part;

<%if loop_links%>
<%loop loop_links%>
Put how you want the links to look here...you can use the normal link.html template tags too...
<%endloop%>
<%endif%>

Hopefully that helps.

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: [AndyNewby] Search results customization In reply to
Thanks Andy!

I don't have problems with customizing appearance of links.

My problem is <%category_results%>.
Quote Reply
Re: [Payooo] Search results customization In reply to
How about doing a similar thing, but replacing <%category%> with a <%loop loop_category%> loop? Then just define the category as you wouldin sub-category.html.

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: [AndyNewby] Search results customization In reply to
Well, just a bunch of errors.

Every time I try to come up with something, one "Unknown Tag" is waiting for me Blush

I'm just a newbie, please help me Smile

Thanks
Quote Reply
Re: [Payooo] Search results customization In reply to
Exactly what code do you have for 'search_results.html' for the category section? Also, what errors are you getting, its may help to track the problem down.

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: [AndyNewby] Search results customization In reply to
I tried with:

<%if category_results_loop%>
<%loop category_results_loop%>
<a href="<%URL%>"><%Short_Name%></a>
<%endloop%>
<%endif%>

And other variations ...

With results:

Unknown Tag : URL
Unknown Tag : Short_Name



U believe the problem is with available tags in search_results.html.

The following tags are available:

link_results
link_results_loop
category_results
category_results_loop
link_hits
cat_hits
next
query
term



Thanks for your patience!
Quote Reply
Re: [Payooo] Search results customization In reply to
Mm, sorry I'm stumped. Its easy with links, but I'm not quite so sure with categories Crazy

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: [AndyNewby] Search results customization In reply to
Thanks Andy!

Anybody else?
Quote Reply
Re: [Payooo] Search results customization In reply to
Looking at Links::User::Search, it seems all the tags from the Category table, plus 'title_linked' should be available in the <%loop category_results_loop%>...<%endloop%> construct:

Code:
# Now format the category results.
my $count = 0;
my ($category_results, @category_results_loop);
if (!$filter and $cat_count) {
while (my $cat = $cat_sth->fetchrow_hashref) {
last if ($count++ > $args->{mh});
my $title = Links::Build::build ('title_linked', { name => $cat->{Full_Name}, complete => 1, home => 0 });
$category_results .= "<li>$title\n";
$cat->{title_linked} = $title;
push @category_results_loop, $cat;
}
}


The available tags in the <%loop%> portion include:

Code:
$VAR = [
{
'Description' => 'SUB0 ',
'Meta_Description' => '',
'Name' => 'Games & Fun',
'Header' => '',
'Has_Changed_Links' => 'No',
'Full_Name' => 'Hobbies and Entertainment/Games & Fun',
'title_linked' => ' <a href="http://identitydots.com/LinkSQL/pages/Hobbies_and_Entertainment/index.html">
Hobbies and Entertainment</a> : <a href="http://identitydots.com/LinkSQL/pages/Hobbies_and_Entertainment/Games___Fun/index.html">
Games & Fun</a>',
'FatherID' => '47',
'Newest_Link' => '2001-03-21',
'Category_Template' => undef,
'Timestmp' => '20020120115853',
'Footer' => '',
'Has_New_Links' => 'No',
'Number_of_Links' => '34',
'ID' => '10',
'Meta_Keywords' => '',
'Description_Long' => undef
}
];




But, as you'[ll notice, it doesn't include the "extra" tags that you get in category.html.

Maybe Alex should consider bringing this into sync with the other category printing routines.

From Links::Build

Code:
# Clean up the name.
my $clean_name = $cat_db->as_url ($category->{Full_Name});
if ($opts->{nh} and ($opts->{nh} > 1)) {
$display{title_linked} = build ('title_linked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
$display{title} = build ('title_unlinked', $category->{Full_Name} . '/' . Links::language('LINKS_PAGE', $opts->{nh}));
}
else {
$display{title_linked} = build ('title_linked', $category->{Full_Name});
$display{title} = build ('title_unlinked', $category->{Full_Name});
}
$display{category_name_escaped} = GT::CGI->escape ($category->{Full_Name});
$display{category_clean} = $display{title};
($display{category_short}) = $display{category_name} =~ m,/?([^/]+)$,;


This is what makes the other tags available. You might want to hack them in to the Search.pm file.
[/font]


PUGDOG� Enterprises, Inc.

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

Last edited by:

pugdog: Feb 22, 2002, 5:41 AM