Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Using tags in a global?

Quote Reply
Using tags in a global?
I just tried using the <%date%> tag in a new global I made...but all it does is print it out. Is there a way to get the results of the <%date%> tag to be included in a global?

Hopefully that was clear enough Tongue

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 tags in a global? In reply to
globals are perl code or strings hence you can't use tags.

You'll need to use perl to generate the date.
Quote Reply
Re: [Paul] Using tags in a global? In reply to
So, how could I access them if the code was in a sub?

$var_name, or is it in some array?

Thanks

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 tags in a global? In reply to
Ok...where is the 'globals' code stored? (like Editor.pm etc) If I have a look at that, and see how the globals are passed, hopefully I can see how to access other variables in a global..

Thanks

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 tags in a global? In reply to
It's not as simple as that.

You'll need to either use perl to create a date like:

scalar localtime

...or do() the globals file.

my $globals = do "/path/to/globals.txt";

Then evaluate the tag.
Quote Reply
Re: [Paul] Using tags in a global? In reply to
Thats what I was thinking. I only gave the date as an example, it is infact a piece of text that is included as another global that I need to include. Its in the several times, so I thought it would be better to have the one global defined, and then that global can be called as many times as needed to give the smae result.

Thanks

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 tags in a global? In reply to
I think it is something like:

Code:
my $globals = do("$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/globals.txt");
my $wanted = $globals->{KEY};
my $output = eval $wanted;

Last edited by:

Paul: Jun 7, 2002, 10:23 AM
Quote Reply
Re: [Andy] Using tags in a global? In reply to
Maybe I am being dense, but have you tried in your global:

Code:
my $tags = shift;
my $date = $tags->{date};


This should give you access to "date" if it is a valid tag on the page the global appears on...

--
Matt G

Last edited by:

Matt Glaspie: Jun 12, 2002, 8:51 PM