Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

HTML page for every link

Quote Reply
HTML page for every link
Can I somehow set Links.pm to only build an individual html page if a particular field is filled in?

ie: text entered into a field named Detail

Thanks
Rennie




Quote Reply
Re: HTML page for every link In reply to
just make a field called isDetail and make it a yes no field.. with the default set to No

then in the query to build the detailed pages.. put

WHERE isDetail = 'Yes'

jerry

[This message has been edited by widgetz (edited November 19, 1999).]
Quote Reply
Re: HTML page for every link In reply to
I only wanted to have a detailed page if my LongDesc field was filled in, otherwise all the information was on the category page, and the detail page was redundant.

All I did was put a test in the category template such that if the LongDesc was positive, it added an HTML link "more..." to the category pages that linked to the detail page. It still built them, but people were not prompted to jump to it unless it had extra information. The title still linked to the direct jump.

Quote Reply
Re: HTML page for every link In reply to
You could add in nph-build.cgi right after:

while ($link = $sth->fetchrow_hashref) {

add:

next unless ($link->{MyField});

this will only build pages if MyField is true (i.e. not blank or equal to 0).

Cheers,

Alex
Quote Reply
Re: HTML page for every link In reply to
To see how the <%if LongDesc%> test works, check out the new page on my site -- the links that have the field filled in have a short description listed, then a prompt to click for more.


http://www.postcards.com/DigitalPostcards/pages/


This is a cluttered version.


http://www.postcards.com/pcSQL/pages/Cool/


Shows how I did it with just a 'details..'

These are TEMPLATE based, just putting the code inside the <%if..%><%endif%> block.

You don't have to modify any source code..

The advantage of Alex's way, is if you had a large site, you would not generate (and thus waste time or disk space) pages that would not be linked to. The disadvantage is you'd have to make that change in each new release of the program.

The Template based method will work from version to version.



------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/







Quote Reply
Re: HTML page for every link In reply to
Thanks

I seem to have this working fine, and have two add scripts- all I need now is two modify scripts which I'm working on just now.

Rennie
Quote Reply
Re: HTML page for every link In reply to
sorry.. i wanted to clarify something..

i beleive this is the best way to do it..

New Field in Links Database..

Name: isDetail
Size: 3
Max : 3
Default: No
Validation: Yes|No

Then in nph-build.cgi.. sub build_detailed_view

find:

Code:
$sth = $LINKDB->prepare ("SELECT * FROM Links LIMIT $set_limit");

change it to

Code:
$sth = $LINKDB->prepare ("SELECT * FROM Links WHERE isDetail = 'Yes' LIMIT $set_limit");

it works great now.. it should be faster and save more memory.. the last way you did it lcnl it gets all the links and then skips the one that isn't detailed.. this one only gets the detailed ones..


------------------
Jerry Su