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

Products: Gossamer Links: Development, Plugins and Globals: Re: [Doc_] How to add number in front of links on LinkSQL 2.1.2?: Edit Log

Here is the list of edits for this post
Re: [Doc_] How to add number in front of links on LinkSQL 2.1.2?
First of all, you have to use the 'link_results_loop' and 'category_results_loop' tags as pugdog said. No need to edit your code, though....

Use this global (calculate_search_offset):
Code:
sub {
my $nh = shift;
my $mh = shift;
return {search_offset => 0 } unless $nh =~ /^\d+$/;
$mh ||= $CFG->{search_maxhits};
return { search_offset => ($nh - 1) * $mh };
}

Do something like the following in the search_results.html template:
Code:
<%set search_page = 1%>
<%calculate_search_offset($nh,$mh)%>
<%loop link_results_loop%>
<%include link.html%>
<%endloop%>

Finally, in link.html, put the following code wherever you want the number to appear:
Code:
<%if search_page%>
<%row_num + $search_offset%>.
<%endif%>

I just added this on my page, have a look at
http://www.iyengar-yoga.com/...earch.cgi?query=yoga

Ivan
-----
Iyengar Yoga Resources / GT Plugins

Last edited by:

yogi: Feb 4, 2003, 10:09 AM

Edit Log: