http://www.perlmonks.org?node_id=308785

mkenney has asked for the wisdom of the Perl Monks concerning the following question:

I hope I'm not asking in the worng area, if I am I apoligize...

I'm starting to use HTML::Template for my web pages. How do I get them to show up in Macromedia's Dreamweaver MX for page editing etc?

Thanks to all the Gurus...

Mark

Replies are listed 'Best First'.
Re: HTML::Template and Dreamweaver MX
by PodMaster (Abbot) on Nov 21, 2003 at 02:44 UTC
    Ain't nobody here but us monks ... this is not a Dreamweaver forum, but you're in luck, there are some helpful things: update: I once wrote something like:
    use HTML::Template; my $t = HTML::Template->new( scalarref => \'[%!-- TMPL_VAR name="foobery" escape=html --%]', filter => sub { my $text_ref = shift; $$text_ref =~ s| \[\% (?:!--\s*)? # ( [Tt][Mm][Pp][Ll]_ [^\]]+? ) #$1 (?:--\s*)? \%\] |<$1>|xg; } ); $t->param(foobery => 'barbery>>'); die $t->output(); __END__ barbery&gt;&gt; at html.template.pl line 11.
    which ought to be Dreamweaver friendly (you write in HTML::Template tags except you substitute < with [% and > with %]. If you do decide to go this route, it's a good idea to make use of template caching ;)

    update: whoops, added missing \/? to regex ... basically updated regex (it's pretty thorough now, although it won't catch NAME="foo%]berry" which is pretty bizzare thing to have.)

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Ya right, nothing but monks. This is the best area for PERL I have ever seen. The answers seem to just appear. Thank-you!!!

      I was hoping to right in HTML::Template tags and view them in Dreamweaver compared to writing in Dreamweaver tags and converting them to HTML::Template. Skip a step and all. Any-way to do this?

      Mark
      A reply falls below the community's threshold of quality. You may see it by logging in.
      That looks great. What do I have to do to add the LOOP and IF statements, or does this already do that. The filter looks universal but I don't understand the scalarref yet. Thanks again for the help, it is appreciatted more then you would ever think...

      Mark
Re: HTML::Template and Dreamweaver MX
by jsprat (Curate) on Nov 21, 2003 at 02:59 UTC

      And i haven't really touched it since. The problem was that even though you have tools to insert tags and see them on the screen, you don't see the interpolated values. I found that i could edit my template by hand (via vi) easier, but i still start with Dreamweaver and use it to make widgets which i insert later. In other words, i haven't found a good way to maintain my HTML::Template site with Dreamweaver, but it is still very useful to start with Dreamweaver.

      MX is a funky beast of a program. The version(s) prior to MX 2004 would only work if you have a ColdFusion, ISS, or Java web server. That's it! You couldn't even edit the HTML! I quickly switched back to plain ole Dreamweaver, but the new MX 2004 version added PHP to the mix, which makes me think it could be tricked into working with plain ole Perl CGI's ... too bad my evaluation copy ran out. :( Good thing i learned vi! ;)

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)
      
Re: HTML::Template and Dreamweaver MX
by asarih (Hermit) on Nov 21, 2003 at 02:49 UTC
Re: HTML::Template and Dreamweaver MX
by tphyahoo (Vicar) on Feb 23, 2005 at 12:57 UTC
    All these answers had to do with integrating "Dreamweaver Templates" with perl. Dreamvaver Templates are a dreamwever content management feature, not to be confused with any of the perl template solution.

    I don't think the user wanted help with this specific dreamweaver feature, just vanilla use of Dreamwever

    I don't know of any easy solution for integrating HTML::Template and Dreamweaver. (Doesn't mean there isn't one, I just started researching this myself.)

    However see Dreamweaver/Perl integration tools where I link to a page that suggests that Dreamweaver plays well with Mason.