Re: Perl + Dreamweaver?



On 2005-04-19, Nikos <hackeras@xxxxxxxxx> wrote:
> Scott Bryce wrote:
>> Nikos wrote:
>>
>>> How does he passes values to the pages he produces with Dreamweaver?
>>> By using Dreamweaver?
>>
>>
>> It is beginning to look like you don't really understand the process
>> well enough to understand how to use the tools available.
>>
>> Come up with a short, simple example to try out. If you can't get it to
>> work, post what you tried, and we can help. Gunnar gave you a good
>> example to start with.
>>
>> All you are doing now is telling us that you don't understand. We know
>> that, but it doesn't help us help you.
>
> Yes that is correct, i will try make somethign on my own to simplify
> Gunnars example to something very easy and if i cant get it to work i
> will post it here. Iam on to that now.
>
> You are right. I must try that to see what *exactly* is what i dont
> understand.

The classic templating problems are:

1) How do you allow inline code without having the editor
kill your code syntax?

Some editors have a <notouch> CODE </notouch> setup
of some kind and you can instruct them not to relocate
comments. I don't know if Dreamweaver is one of these.

When I looked at this years ago, I found that most editors
would kill your code in some fashion or another -- moving
comments around, not allowing comments between table
elements, etc.

2) How do you specify URLs so that you can make them dynamic?
Almost all code is going to require rewriting URLs in some
fashion if you are going to remain relatively portable.

3) How do you use a common image library without having
to carry all images around with you or specify absolute
paths? A lot of the "components" you get with editors
screw this up by using JavaScript to load image -- almost
always without giving you control of the paths involved.

4) How do you dynamically specify page components and
get them inserted in the right place?

ASP has done a pretty good job of this, and I presume a lot of editors
support it. The big problem with ASP is that of all of the inline
templating styles, that you have to do something early in order
to get it inline in the proper place.

The best solution I have found is to do a complete templating
with two-pass processing. I use Interchange, and you can specify
a base template:

<html>
<head>
{{CSS}}
{{HEAD}}
</head>
<body>

<table>
<tr>
<td style="vertical-align: top; width: 20%">
{{LEFT}}
</td>
<td style="vertical-align: top; width: 60%; padding: 5px">
{{TOP}}
{{:DEFAULT}}
{{BOTTOM}}
</td>
<td style="vertical-align: top; width: 20%">
{{RIGHT}}
</td>
</table>

{{COPYRIGHT}}
</body>
</html>

Then you do code which fills those areas, and do a template substitution.
There can be a fair amount of string copying going on, which doesn't make
for the best performance, but for most applications it seems to work well.

XSLT is another thing to look at for a two-pass system -- obviously you
produce XML and then relocate it to a template.

--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/

Be patient. God isn't finished with me yet. -- unknown
.



Relevant Pages

  • Re: Page Directive & Dreamweaver??
    ... so your premise that DreamWeaver is not intended ... > edit .aspx files. ... Editors such as Dreamweaver are HTML editors and do not ... > If you really want to use a graphical HTML editor, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Stripy tables (Dreamweaver plugin or other tool wanted)
    ... No, good text editors, not Notepad. ... server-side scripts which generate HTML; the OP has existing pageof HTML which he wants to edit with "help" from some utility. ... I wouldn't disagree that there are plenty of good and useful text editors out there and I certainly wouldn't argue with anyone who preferred to use one of those instead of Dreamweaver. ...
    (uk.net.web.authoring)
  • Re: Page Directive & Dreamweaver??
    ... since that is what Visual Studio uses by default. ... But I have seen the HTML output of Dreamweaver, ... Editors such as Dreamweaver are HTML editors and do not ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Security Minds versus Malicious Minds Book
    ... scribbling their name and phone number on the bathroom wall in ... >> editors), but why learn the program if using it is more complicated ... Writing the code manually is far more ... I've never had that problem with dreamweaver, ...
    (alt.computer.security)