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

%tags not being passed to link.html or subcategory.html

Quote Reply
%tags not being passed to link.html or subcategory.html
The %tags array is not passed to those templates, so the Links.pm globals are not available in the template -- specifically the <%build_root_url%> and the ilk. I was trying to have my new graphic link to the What's New page, while the title linked to the proper area.

I figured out how to add this to the link.html template, by adding the specific parameter to the HTML_Templates.pm subroutine .

Alex... maybe you should consider passing those arguments (at least the ones in Links.pm) to the link.html and subcategory.html

If anyone wants to know how to do it for the links.html template, I can post it, but I can't seem to make it work for the subcategory.html. I guess I have to look in the nph_build file for the calls....

Hopefully this will be a fix in the 1.1a release, since it's reasonable to expect those variables to be available in the sub-templates -- link.html and subcategory.html -- so hacking the files *hopefully* will be of only limited use Smile
Quote Reply
Re: %tags not being passed to link.html or subcategory.html In reply to
Can you show me what you changed? From what I can see, everything in %GLOBALS should be available to link.html. To make it available for subcategory.html change:

$output .= &load_template ('subcategory.html', $cat_r, %GLOBALS }, undef, $template);

to:

$output .= &load_template ('subcategory.html', { %$cat_r, %GLOBALS }, undef, $template);

Cheers,

Alex
Quote Reply
Re: %tags not being passed to link.html or subcategory.html In reply to
Code:
my $output = &load_template ('link.html', {
detailed_url => "$LINKS{db_detailed_url}/${$rec}{'ID'}$LINKS{build_extension}",
build_new_url => "$LINKS{build_new_url}",
%$rec,
%$user,
%GLOBALS
}, undef, $template);

The addition of the second parameter made it work, without it, it fails.

I tried to do the same thing with the subcategory.html but I guess I put the {} hash grouping in the wrong place? I'll try it again.

Alex -- have you modified the downloadable zip? Is it worth downloading and re-installing the code??

Quote Reply
Re: %tags not being passed to link.html or subcategory.html In reply to
Not yet, I'm going to wait a little bit (not more then another week) and release a bug fix version that will address all the issues discovered on the forum.

Cheers,

Alex