Gossamer Forum
Home : Products : DBMan SQL : Discussion :

not using templates

Quote Reply
not using templates
Is there any way to use this program and not use the templates? They are quite restrictive in the different things that you can do with the databases compared to using the non html.pl method.

How would you call subroutines or include output from programs other than DBMan?


Quote Reply
Re: not using templates In reply to
1) Nope...that is part of the new DBMAN. And actually, they are quite flexible. The newer GT template system for all its products allows you to embed Perl features/functions, and soon you can even include LOOPING codes.

2) Create GLOBAL tags similar to the WebAdverts for Links 2.0 (codes posted in the Links 2.0 forum. Then use the GLOBAL tags in the TEMPLATE files.

EXAMPLE:

Put the following in your default.cfg file (or in the new PM file that contains all your variable settings):

Code:

sub insertadvert {
#---------------------------------------------------------
# Insert Banner Ad

my $ad = `/full/path/to/script.cgi`;
# $ad =~s,Content-type:\stext/html,,;
return $ad;
}


Then create a GLOBAL TAG:

Code:

banner => \& GT::Config::insertadvert,


Then in your template files, use:

Code:

<%banner%>


Of course, the above syntax would have to be modified to work with the new plug-in system that is available across all GT products.

I would recommend perusing the LINKS SQL PLUGINS and other forums to get a feel for the plug-in system.

Regards,

Eliot Lee
Quote Reply
Re: not using templates In reply to
I've got it running easy enough, but what I can't tell is if it does anything different than the previous version, and if it will be worth going through the effort to upgrade.
Do you know if there is anything different in the basic database functionality?