Re: Perl + Dreamweaver?
- From: Mike Heins <mikeh@xxxxxxxxxxxx>
- Date: Tue, 19 Apr 2005 15:21:28 -0000
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
.
- References:
- Perl + Dreamweaver?
- From: Nikos
- Re: Perl + Dreamweaver?
- From: Lord0
- Re: Perl + Dreamweaver?
- From: Nikos
- Re: Perl + Dreamweaver?
- From: Gunnar Hjalmarsson
- Re: Perl + Dreamweaver?
- From: Nikos
- Re: Perl + Dreamweaver?
- From: Gunnar Hjalmarsson
- Re: Perl + Dreamweaver?
- From: Alan J. Flavell
- Re: Perl + Dreamweaver?
- From: Nikos
- Re: Perl + Dreamweaver?
- From: Scott Bryce
- Re: Perl + Dreamweaver?
- From: Nikos
- Perl + Dreamweaver?
- Prev by Date: Re: Perl + Dreamweaver?
- Next by Date: Re: Perl + Dreamweaver?
- Previous by thread: Re: Perl + Dreamweaver?
- Next by thread: Re: Perl + Dreamweaver?
- Index(es):
Relevant Pages
|