Mailing List Archive

[Fwd: tag wish list [LONG]]
Gerald,

i know you are now contemplating the next major release.
you've indicated your intention to adapt a new parser or rewrite one
from scratch. also, you've indicated that some tags may change,
be eliminated, or made configurable. in that vein i am offering my wish

list for the new tag implementation.

we are using dreamweaver at our site, and it does not
mix well with embperl. since dreamweaver does not
recognize the embperl tags, it renders them in the gui
design window as text.

designers are careful to layout every pixel with care.
if we type in something like:

[- foreach $data (sort keys %{$hashref}){ -]

it will take up space on the interface. the page looks just plain ugly
in the gui, and it is not feasible to make a small change, save the
page,
bring the page up in the browser, etc. etc.. since the designers cannot

properly design a page with embperl code included, i end up having to
add
it by hand when they are done. this is tedious at best.

using a standard tag such as <%
and coupling it with a variable char to indicate the embperl command
type,
we get the following:

[.- becomes <%-
[.! becomes <%!
[.* becomes <%*
[.# becomes <%#
[.$ becomes <%$

the designer can view the tags and edit them when they
go into 'html source' editing mode, but the tags and their contents
will neatly disappear when they are using the gui to layout the page.

the above trick should work fine for everything except [.+. in this
case there is some space that needs to be taken up since some
result will be inserted into the html stream for output. even better
than
taking up space, would be to emit some example text. this would
give the designer the ability to layout the page in the gui with
a wysiwyg environment.

how about enclosing tags with example text? such as:

<%( $ref->[$row]{$fieldvar} (%> EXAMPLE TEXT <%))%>

the <% %> cause everything between the tags to be ignored
by dreamweaver and not rendered in the gui.
the <%( is exactly like using the [.+ except that after the
perl is output, all data in the file is ignored until <%))%> is scanned.

i originally thought of adding an ID (ala html/xml) such as:
<%(MY_ID $ref->[$row]{$fieldvar} (%>EXAMPLE TEXT<%)MY_ID)%>

but i am not sure the extra complication would be warranted. how would
we
handle nested ID's and nested example text?

this technique will also allow dreamweaver to properly size the columns
of a table. currently if i add the following to a table:

[+ $prdstdans[$row]{UOM} +]

it causes the table to be widened to fit the entire field. in this
particular
case the unit of measure field normally returns only two characters, so
the
field ends up being sized much too wide. but if we enter the following:

<%( $prdstdans[$row]{UOM} (%>CS<%))%>

dreamweaver correctly sizes the column for the 2 digit example result.

this new technique would give the designer the ability to layout the
page
in the gui with a wysiwyg environment. the embperl commands can be
added in the source editing window by either the designer or a
programmer,
without destroying how the page is rendered in the dreamweaver gui or in

a static view of the page in a browser.

thanks for your consideration and for a great product which includes
better tech support than anything i have ever paid for.

cliff rayman
genwax.com
RE: [Fwd: tag wish list [LONG]] [ In reply to ]
Cliff,
>
>
> we are using dreamweaver at our site, and it does not
> mix well with embperl. since dreamweaver does not
> recognize the embperl tags, it renders them in the gui
> design window as text.
>

Yes, that is the intented way it should do...

>
> using a standard tag such as <%
> and coupling it with a variable char to indicate the embperl command
> type,...
> the designer can view the tags and edit them when they
> go into 'html source' editing mode, but the tags and their contents
> will neatly disappear when they are using the gui to layout the page.
>

Yes, that the other syntax (or something similiar, I haven't made the final
decision) I like to support in the next release, for the reason you already
mentioned above.

>
> how about enclosing tags with example text? such as:
>
> <%( $ref->[$row]{$fieldvar} (%> EXAMPLE TEXT <%))%>
>

Another possibility would be fixing the old and new syntax:

<%+ $ref->[$row]{$fieldvar} +%>[# EXAMPLE TEXT #]

this is a little bit short and (maybe) easier to read (but has at least four
characters ([##])

>
> i originally thought of adding an ID (ala html/xml) such as:
> <%(MY_ID $ref->[$row]{$fieldvar} (%>EXAMPLE TEXT<%)MY_ID)%>
>
> but i am not sure the extra complication would be warranted.

What purpose should such an ID serve?

>
> this new technique would give the designer the ability to layout the
> page
> in the gui with a wysiwyg environment. the embperl commands can be
> added in the source editing window by either the designer or a
> programmer,
> without destroying how the page is rendered in the dreamweaver gui or in
> a static view of the page in a browser.
>

Yes, I agree

Gerald

-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
Re: [Fwd: tag wish list [LONG]] [ In reply to ]
Gerald Richter wrote:

>
>
> Another possibility would be fixing the old and new syntax:
>
> <%+ $ref->[$row]{$fieldvar} +%>[# EXAMPLE TEXT #]
>
> this is a little bit short and (maybe) easier to read (but has at least four
> characters ([##])
>

this still would not work for my unit of measure example. our unit
of measures are 2 characters wide. this would make this table field
a minimum of 6. not a problem for us programmers, but designers are
very picky and rightfully so. another possibility is something like this:

<%+ $ref->[$row]{$fieldvar} %>EXAMPLE TEXT<% +%>

notice there is no '+' in front of the first %> and no '+' in front
of the second <%.

so scanner hits '<%+' goes into embperl 'plus mode'
scanner hits '%>' and ignores everything until next '<%'
scanner goes back into plus mode until it hits '+%>'.


>
> >
> > i originally thought of adding an ID (ala html/xml) such as:
> > <%(MY_ID $ref->[$row]{$fieldvar} (%>EXAMPLE TEXT<%)MY_ID)%>
> >
> > but i am not sure the extra complication would be warranted.
>
> What purpose should such an ID serve?

yes. i left out that part. i actually had abandoned most of the concepts
related to that. but i will include them here for completeness.

I was thinking that the ID would be available
in a variable in embperl such as $id. subroutines could then use it
to determine output. it might make it easier on the web designers if
they could simply type:
<%(MY_ID outputstuff(); (%>EXAMPLE TEXT<%)MY_ID)%>

OR

<%(MY_ID outputstuff(); %>EXAMPLE TEXT<% MY_ID)%>

obviously we would have included a subroutines package somewhere in the
header and written something like:

<%$ sub outputstuff $%>
<%+ $udat{$id} if $id=~m!^MY_!; +%>
<%$ endsub $%>

the reason for the trailing id is for later addition of nesting.
so instead we would have @id and we could inspect @id
to get our hierarchy. in a way we are incorporating an
xml into embperl.

embedded in the page:
<%(PART $fdat{PART} %>541201
<%(DESC outputstuff() %>12" taper candles<% DESC)%>
<%(UOM outputstuff() %>EA<% UOM)%>
<%(PRICE outputstuff() %>15.25<% PRICE)%>
<% PART)%>


as opposed to similar for designer but with info from a different
souce:

<%(ORDER $reftodata->[$row]{$ordlin} %>4
<%(PART outputstuff() %>541201<% PART)%>
<%(DESC outputstuff() %>12" taper candles<% DESC)%>
<%(UOM outputstuff() %>EA<% UOM)%>
<%(QTYORD outputstuff() %>15.00<% QTYORD)%>
<%(PRICE outputstuff() %>15.25<% PRICE)%>
<%(EXTENSION outputstuff() %>228.75<% EXTENSION)%>
<% ORDER)%>

and the subroutine:
<%$ sub outputstuff %$>
<%+
if ($id[$#id-1] eq 'PART'){
$returned_from_product_catalog{$fdat{PART}}{$id[$#id]};
} elseif $id[$#id-1] eq 'ORDER'{
$returned_from_order_data{$reftodata->[$row]{$ordlin}}{$id[$#id]};
}
+%>
<%$ endsub $%>



cliff rayman
genwax.com
RE: [Fwd: tag wish list [LONG]] [ In reply to ]
> yes. i left out that part. i actually had abandoned most of the concepts
> related to that. but i will include them here for completeness.
>
> I was thinking that the ID would be available
> in a variable in embperl such as $id. subroutines could then use it
> to determine output. [...]

For this things I think we should really go with XML and Embperl 2.0 will do
a start in this direction...

Gerald