Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Different Tags with a global ?

Quote Reply
Different Tags with a global ?
I have some additional databases in my links, so i have to write globals to fetch the data from them.
While i need different data from this fields on different places at my site, i ask if its possible to fetch the whole set and return not only the tag for the global but also different tags inside it?

Table Test
Field 1
Field 2

Normally i make

global testfield1
select ...


global testfield2
select ...

but i would like something like

global Test

select field1, field2

return field1 => value, field2 => value

and use it with

Test.field1 or something like this.

Any idea?
Quote Reply
Re: [Robert] Different Tags with a global ? In reply to
>>>...additional databases in my links...<<,

You mean tables, not databases, right?

I'm a little confused as to what you are asking for Unsure


Andy (mod)
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: [Robert] Different Tags with a global ? In reply to
Yes, you can just select both fields and then

return {Field1 => $field1, Field2 => $field2};

and then you will have the tags <%Field1%> and <%Field2%> available in the template.

To use this you need to call the global from somewhere near the top of your template (the tag wont return any values itself) and then below it you will be able to use the tags.

The UK High Street