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

CategoryAlternates additional fields?

Quote Reply
CategoryAlternates additional fields?
Origianl Post, added to:
In Reply To:
Has anyone tried to add fields to the CategoryAlternates table and make those fields available to the link.html template?
pugdog thanks for your help on this one too, your thoughts were insightful and it was your questions that brought the solution to me...
Code:
# Generate the links listing.
for my $i (0 .. $#{$links_r}) {
last if (ref $links_r->[$i] ne 'ARRAY');
$tmp = $LINKDB->array_to_hash ($links_r->[$i]);
$OUT{links} .= &site_html_link ($tmp, $in);
}
for my $i (0 .. $#{$alt_r}) {
last if (ref $alt_r->[$i] ne 'ARRAY');
$tmp = $FAKEDB->array_to_hash ($alt_r->[$i]);
$OUT{links} .= &site_html_slink ($tmp, $in);
}
With this in page.cgi and nph-build.cgi as well as adding a fake .def file to read in the the extra fields from CategoryAlternates, I was able to get my Link extension fields into the templates. Now each link can basically have as many additional field values as I choose to put in the alternates table. I just hope it works in the long haul...

If anyone is interested in doing something like this send me a private message and I can give you more details. PS: pugdogs comment about this not being the best solution was indeed accurate if you only plan on having a couple few 'stores'. But for the purposes of my site this was my best option where the BGII game has prolly close to 45-50 stores that will need populating and having an extra 45-50 fields in the links table not to mention 45-50 <%if%> statements in my templates for just one field wasn't the way to go, then add in a 'store' for each major encounter and that number is closer to 200/300. Sorry pugdog I hadn't really made it clear as to why I was going about it the way I was.
Subject Author Views Date
Thread CategoryAlternates additional fields? phoule 3907 Nov 15, 2000, 12:43 PM
Thread Re: CategoryAlternates additional fields?
phoule 3836 Nov 15, 2000, 4:24 PM
Thread Re: CategoryAlternates additional fields?
pugdog 3861 Nov 15, 2000, 4:34 PM
Thread Re: CategoryAlternates additional fields?
phoule 3841 Nov 15, 2000, 4:44 PM
Thread Re: CategoryAlternates additional fields?
pugdog 3835 Nov 15, 2000, 5:07 PM
Thread Re: CategoryAlternates additional fields?
phoule 3837 Nov 15, 2000, 5:49 PM
Thread Re: CategoryAlternates additional fields?
phoule 3840 Nov 15, 2000, 6:08 PM
Post Re: CategoryAlternates additional fields?
phoule 3797 Nov 20, 2000, 7:46 AM