On Mon, Dec 15, 2008 at 7:50 AM, Adam Jimerson <vend...@charter.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dermot Paikkos wrote:
>>> -----Original Message-----
>>>> http://www.template-toolkit.org/
>>>>
>>>> Mike
>>> Looking at the website and the documentation, still reading through
>> it,
>>> I'm still not sure how to mix this with my CGI scripts to make them
>>> look
>>> like the rest of the site even though Konqueror supports the <object>
>>> tag, which I would think would be the last browser to support it.  It
>>> may just be that I'm new to CGI so I'm having to take what I am
>>> learning
>>> and throw it out the window?
>>
Your first question was:

> Is it possible to embed a CGI scrip into a HTML page?

Now you say:

> I'm not trying to put perl code into the page

You will get better answers if you start with clearer questions.

> I have the page generated by my CGI script inside another page that is
> using my CSS.  I've tried to have my CGI script directly handle my CSS
> but it didn't work due to its limited support for CSS.  So now I'm
> trying to find a better way to make my CGI script look like the rest of
> my site, I'm guessing this is what Template Toolkit if I can figure out
> how to do it, or if my solution is the best.

Are you using CGI.pm?

If so, you can use css by adding: -style=>{'src'=>'/mystyle.css'} to
the aguments of start_html:
print $q->start_html(-style=>{'src'=>'/mystyle.css'});

This will cause your cgi code to use the stylesheet.

If you are not using CGI.pm please specify what other module(s) you
are using, or if you are just generating the html yourself (not
recommended).

If you are generating the html directly in your perl code, you can
insert a stylesheet reference between the <head> and </head> tags just
as you do in a plain html page.

Template toolkit is a very useful and powerful tool, but it is
probably overkill if all you want to do is use stylesheets.  You can
do lots of other things with Template::Toolkit that may make it worth
the time is takes to learn how to use it.  For example, having header
and footer information that appears on all of the pages on your site
in a template, allowing you to make one change to the template and
have that effect your entire site.  You can also use template toolkit
to generate static pages, so you can use templates to generate pages
that do not require cgi, and re-used those templates in you cgi
scripts.

Mike

-- 
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/


Reply via email to