Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Number My Link?

Quote Reply
Number My Link?
Hello,

How do I get numbers to show up in front of my links?

E.g. -

1. Yahoo.com - info
2. MSN.com - info

Because now it’s just

Yahoo - info
MSN - info

Thanks

I feel the numbers make it better to navigate.
Quote Reply
Re: [Coralwave] Number My Link? In reply to
I think you can just add <%row_num%> to your links template, since it's all dynamic, unless you've changed it.

it will not increase from page to page, but will start at 1 each time. You'd need to do a page multiplier and then add row_num to it if you want links to increment across pages.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Number My Link? In reply to
In Reply To:
I think you can just add <%row_num%> to your links template, since it's all dynamic, unless you've changed it.

it will not increase from page to page, but will start at 1 each time. You'd need to do a page multiplier and then add row_num to it if you want links to increment across pages.


This sounds deep!
Quote Reply
Re: [Coralwave] Number My Link? In reply to
This is an old thread:
http://www.gossamer-threads.com/...i?post=231349#231349
Quote Reply
Re: [afinlr] Number My Link? In reply to

Well now this is an old thread, my licence is for sale.
PM or email me if anyone is interested.

Thanks
Quote Reply
Re: [Coralwave] Number My Link? In reply to
It's not that hard.

It's all in the templates. If you can't edit your templates, no program is going to be any easier.

To get numbers in front of your links, just add <%row_num%> to the link.html template, so it will get numbered. It's just a tag. Like any other.

To have it increment across pages, you need to do some simple tag multiplication, and that is *clearly* outlined in the Template Tutorial that is included in the program's Help area.

You can do this in the templates, by using the paging tag:

paging.current_page will give you the page you are on
paging.max_hits will tell you how many links per page are being displayed

So, to do the incremental page-spanning numbers, you'd do something like:

<%set offset = $paging.current_page - 1%>
<%set offset = $offset * $pageing.max_hits%>

at the top of your category.html (so it only has to be calculated once per page)

and then use

<% $row_num + $offset %> as your row number.

On page 1, the offset will equal zero, so it will not add anything.


For debugging, you can use:
<%set offset1 = $paging.current_page - 1%>
<%set offset = $offset1 * $paging.max_hits%>
offset1 = <%offset1%> and offset is <%offset%>

In category.html to see what the page number is set to, then the offset for each link on the next page.


This code is actually working on one of my sites.


PUGDOG� Enterprises, Inc.

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