Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Inserting additional scripts within templates

Quote Reply
Inserting additional scripts within templates
We would like to include a "Tip System" in our templates that calls another cgi script. I currently have it kludged with an Iframe (but that doesn't work well for Netscape 4(-)

The typical "cgi include" doesn't work with templates. How do we do this?

Thanks!

Diversity by Design
Quote Reply
Re: [diversity] Inserting additional scripts within templates In reply to
Hi,

You could do:

run_script =>
sub { my $output = `/path/to/cgi/script.cgi`; return $output; }

and put <%run_script%> where you want to run it.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Inserting additional scripts within templates In reply to
Can I add that as a field in the Globals, or does it need to go directly into the code. If into the code, where would you suggest?

Thanks!

Diversity by Design
Quote Reply
Re: [diversity] Inserting additional scripts within templates In reply to
Hi,

No, you add the above to the globals and put <%run_script%> or whatever you name it in the template where you want the output to be.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [diversity] Inserting additional scripts within templates In reply to
Alex is talking about a global (admin => Templates => Globals), where:
"run_script" would go in the code text field, and
"sub { my $output = `/path/to/cgi/script.cgi`; return $output; }" goes in the description textbox.

Then you can use <%run_script%> in your templates.

Adrian
Quote Reply
Re: [brewt] Inserting additional scripts within templates In reply to
Great! It's running nicely. Only bummer left is it's converting the html into this kinda stuff: &quot;&lt;i&gt;
(I forgot what they are called) Is it possible to be able to pass html tags thru this without the conversion?

Diversity by Design
Quote Reply
Re: [diversity] Inserting additional scripts within templates In reply to
Change:

sub { my $output = `/path/to/cgi/script.cgi`; return $output; }

To

sub { my $output = `/path/to/cgi/script.cgi`; return \$output; }

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Inserting additional scripts within templates In reply to
Sweet!

This is a very exciting feature! My mind is whirring of all the ways we can integrate additional features into this....

Thanks

Diversity by Design