Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Getting the "if new" field to work in templates

Quote Reply
Getting the "if new" field to work in templates
I am using Templates for links 2.0 and I am trying to get the "if new" field to work on my main page.

When a link is added, I would like the "New" to appear next to the category that is in the left panel of my website on the main page.

Can anyone help me do this? I am sure that it is very simple but for some reason I cannot get it to work.

Thanks,
Chet
Smile

------------------
Webmasters get a sponsor for your website. Over 350 to choose from.
www.websitesponsors.com
Quote Reply
Re: Getting the "if new" field to work in templates In reply to
Odd, that is the default behavior of Links. Check site_html.pl or site_html_templates.pl (whichever you are using), sub site_html_print_cat and make sure this code is there:

Code:
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl>|;

I hope this helps.
Quote Reply
Re: Getting the "if new" field to work in templates In reply to
It is all there.
What I need is the html part to put on my home.html for the templates.
I don't know what it is.


------------------
Webmasters get a sponsor for your website. Over 350 to choose from.
cbrzez.hypermart.net

Quote Reply
Re: Getting the "if new" field to work in templates In reply to
According to the default home.html, you just use:

Quote:
<h2>Categories:</h2>

<%category%>

The <%category%> tag will contain all the html code put in by sub site_html_print_cat.

I hope this helps.
Quote Reply
Re: Getting the "if new" field to work in templates In reply to
I tried that but it makes the categories in two colums and that messes up my index page since I put all my categories in a small panel on the left of the screen.

I could probably hack the script that forms the categories to make them in one column but I can find it anywhere.



------------------
Webmasters get a sponsor for your website. Over 350 to choose from.
cbrzez.hypermart.net

Quote Reply
Re: Getting the "if new" field to work in templates In reply to
Something has happened to my 'new' & 'pop' settings. I've tried everything and nothing seems to work.

I tried to replace the code in the site_html_templates.pl file, as stated in
http://www.gossamer-threads.com/...m11/HTML/000751.html . Didn't work. Checked my category.html and home.html. Looks okay.

Here's the link to my scripts. Permissions open for now. Please help if you can.

http://retroworld.hypermart.net/linker/