Gossamer Forum
Home : Products : Links 2.0 : Customization :

Category description on first page only

Quote Reply
Category description on first page only
Hi guyz,

I want to display category description on the category page, not the main page. I tried this:

1- commenting

$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));

in site_html_templates.pl

2- adding

<%description%>

in category.html

This works, but the description will still be displayed in page2 (more2.shtml) page3 (more3.shtml), while what I need it is displayed only on the first page (index.shtml)

Any other solution?



Thanks
Quote Reply
Re: [faeirouz] Category description on first page only In reply to
install the "New parse for =~" mod (http://gossamer-threads.com/...ttach/1088-parse.txt). then you could try:

Code:
<%ifnot category =~ "\/"%>
<%description%>
<%endif%>

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] Category description on first page only In reply to
Quote:
install the "New parse for =~" mod (http://gossamer-threads.com/...ttach/1088-parse.txt). then you could try:


is that the same as what I found @ the resourse center: Enhanced Template Support ?

I tried the later, and include

Code:


<%ifnot category =~ "\/"%>
<%description%>
<%endif%>


but still no luck. The result is still the same.. but when I installed the one from yout suggested link, the pages are blank!


Quote Reply
Re: [faeirouz] Category description on first page only In reply to
First of all, you only need to update one of the following files:

site_html.pl (if you are not using templates)
site_html_templates.pl (if you are using templates)

Second, the field names are case sensitive, so you need to use:

<%Description%>
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Category description on first page only In reply to
1- what should I do with the site_html_templates.pl? I've already commented out the description part..

2- <%Description%> ? In the script, $description is used.. so the correct one should be <%description%>
Quote Reply
Re: [faeirouz] Category description on first page only In reply to
If you are using templates, then you need to edit the category.html template FILE.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Category description on first page only In reply to
Unless you have changed the case of the "Description" field in the category.def, then you DO need to use <%Description%>....

Look at the following default category.def hash:

%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
Description => [2, 'alpha', '40x3', 500, 0, '', ''],
Related => [3, 'alpha', 0, 255, 0, '', ''],
'Meta Description' => [4, 'alpha', 40, 75, 0, '', ''],
'Meta Keywords' => [5, 'alpha', 40, 75, 0, '', ''],
Header => [6, 'alpha', 40, 75, 0, '', ''],
Footer => [7, 'alpha', 40, 75, 0, '', '']
);

See Description, not description.....
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Category description on first page only In reply to
Quote:
QuoteCodeIf you are using templates, then you need to edit the category.html template FILE


I've already edited it... and as I said b4, the description appears at every single page (index.shtml. more2.shtml, more3.shtml...) What I need is that it only appears at index.shtml, not other pages...
Quote Reply
Re: [Stealth] Category description on first page only In reply to
but if you take a look at the category.html itself, it uses small letter for ALL variables



Code:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/...EC-html40/strict.dtd">
<html>

<head>
<title><%site_title%>: <%category_name%></title>

<%if meta_name%>
<meta name="description" content="<%meta_name%>">
<%endif%>
<if meta_keywords%>
<meta name="keywords" content="<%meta_keywords%>">
<%endif%>

<link rel=stylesheet href="<%build_root_url%>/links.css" type="text/css" title="<%site_title%> style sheet">
</head>
<body>

<p><small class="menu">|
<a class="menulink" href="<%build_root_url%>">Home</a> |
<a class="menulink" href="<%db_cgi_url%>/add.cgi">Add a Site</a> |
<a class="menulink" href="<%db_cgi_url%>/modify.cgi">Modify a Site</a> |
<a class="menulink" href="<%build_root_url%>/New">What's New</a> |
<a class="menulink" href="<%build_root_url%>/Cool">What's Cool</a> |
<a class="menulink" href="<%build_root_url%>/Ratings">Top Rated</a> |
<a class="menulink" href="<%db_cgi_url%>/jump.cgi?ID=random">Random Link</a> |
<a class="menulink" href="<%db_cgi_url%>/search.cgi">Search</a> |
</small></p>

<p><strong class="title"> <%title_linked%> </strong></p>

<h1><%site_title%>: <%category_clean%></h1>





<!-- Subcategories-->
<%if category%>
<h2><%category_name%> Styles / Organizations:</h2>
<%category%>
<%endif%>


<!-- Links in this category. -->
<%if links%>
<h2>Links: </h2>
<%links%>
<%endif%>

<!-- Next/Previous links if spanning pages. -->
<p align=center>
<%if prev%>
<small><a href="<%prev%>">Prev <%build_links_per_page%></a></small>
<%endif%>
<%if next%>
<small><a href="<%next%>">Next <%build_links_per_page%></a></small>
<%endif%>
</p>



<!-- Related Categories -->
<%if related%>
<h2>Related Categories:</h2>
<ul><%related%></ul>
<%endif%>

<!-- Search Bar -->
<form action="<%db_cgi_url%>/search.cgi" method="GET">
<h2>Search</h2>
<div class="margin">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td><strong class="search">Looking for something in particular?</strong></td></tr>
<tr><td><input type="text" size=15 name="query"> <input type=submit value="Search!"></td></tr>
<tr><td><small class="more"><a href="<%db_cgi_url%>/search.cgi">More search options</a></small></td></tr>
</table>
</div>
</form>

<p><small class="update">Pages Updated On: <%date%> - <%time%><br>
Links Engine 2.0 By: <a href="http://www.gossamer-threads.com/">Gossamer Threads Inc.</a></small></p>

<%include footer.txt%>

</body>
</html>




I did try <%Detailed%> and here's an error message I got from Links

Quote:


Unkown Tag: Description
Quote Reply
Re: [faeirouz] Category description on first page only In reply to
Ok, finally, it works.

What I did:

1- installed enhanced template parser

2- installed span pages mod

3- commented the following code in site_html_templates.pl

Code:
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));


4- inserted the following in category.html

Code:


<%ifnot prev%>
<%description%>
<%endif%>


Now I just need to find mod for enabling search for category detail.

Cool