Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Using Contact_Email tag on all templates

Quote Reply
Using Contact_Email tag on all templates
I've been trying to get the <%Contact_Email%> tag to work on several different pages I created with no success. It works ok on my detailed page, but I can't get it to work on other templates I've written. I'm calling other pages using page.cgi?p=contact&ID=1 which displays the contact page for that link, but view source shows value="Unknown Tag: 'Contact_Email'". I've been changing all kinds of things in a number of pages, but nothing has worked. I've also tried copying some of the different globals that I've found in the forum, but unfortunately nothing yet....

Any help would be greatly appreciated,
Perl Hopefull
Quote Reply
Re: [stilton] Using Contact_Email tag on all templates In reply to
Try this global, it should give you all the links detils (title, URL, description, contact_email etc);

<%global_name($ID)%>

Code:
sub {

my $ID= $_[0];

return '' if !$ID;

my ($Title,$URL,$Description,$Contact_Email,$Contact_Name,$Hits,$Votes) = $DB->table('Links')->select( ['Title','URL','Description','Contact_Email','Contact_Name','Hits','Votes'], { ID => $ID } )->fetchrow_array;

return {

link_Title => $Title,
link_URL => $URL,
link_Description => $Description,
link_Contact_Email => $Contact_Email,
link_Contact_Name => $Contact_Name,
link_Hits => $Hits,
link_Votes => $Votes

}

}

Then use <%GT::Template::dump%> to see the new variables that have been made :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Using Contact_Email tag on all templates In reply to
Andy,

Once again, thanks for your help! I must have tried dozens of globals on my own, (none of which came close I might add), throughout last night and today...only to be solved in a matter of minutes. I should be able to use this code to help with a few other things as well...thanks again!
Perl Hopefull
Quote Reply
Re: [stilton] Using Contact_Email tag on all templates In reply to
It took me a good 5-10 mins to write that. Nowhere near as simple as I thought it would be :(

Glad its working though Cool

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Using Contact_Email tag on all templates In reply to
Looks like I jumped the gun.....It was working ok when I was signed in, but as soon as I signed out, it shows Unable to compile 'global_name': as an error, and none of the individual link tags are available.

I'm going to work some more on this tonight, but any additional info would be greatly appreciated!!!

Thanks,
Perl Hopefull
Quote Reply
Re: [stilton] Using Contact_Email tag on all templates In reply to
Mmm... does it not give any more details?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [stilton] Using Contact_Email tag on all templates In reply to
Hi,

I use a global which I named link_info with the following code:

sub { my $tags = shift; my $link_db = $DB->table('Links'); my $id = $tags->{ID}; my $link_info = $link_db->get($id, 'HASH'); return $link_info; }

Then I place the <%link_info%> tag at the top of custom dynamic pages I create and it will then display the tags like <%Contact_Email%>

--Frank