[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [ic] delimiter for tag parameters


> From: Kevin Walsh
> Sent: Thursday, October 27, 2005 12:22 AM
> 
> Ron Phipps suppressed wrote:
> > Sorry to have so much issue with understanding this.  I'm still
confused
> > how the two differ.
> >
> > We've determined that the following will result in incorrect syntax
when
> > the title contains quotes:
> >
> > [mytag title="[item-field title]"]
> >
> > Why does the following not result in incorrect syntax:
> >
> > [tmpn title][item-field title][/tmpn]
> > [mytag title="[scratch title]"]
> >
> > Does Interchange handle [item-field title] and [scratch title]
> > differently?
> >
> > Perhaps [item-field title] is simply replaced with its value and
> > [scratch title] actually passes it's value differently?
> >
> Yes - that's right.  The [item-field title] is just a marker
> that's replaced by the looping tag with a regex.  [scratch title]
> is a "proper" tag that's interpolated.  The replacement could lead
> to syntax errors in the subsequent interpolation run, as you fount.
> 
> Using the value 'Kevin says "hello"', I'll try to show you what
> each of the two examples does:
> 
> Example #1: Using [item-field] as a parameter:
> 
>     [mytag title="[item-field title]"]
> 
> The above gets parsed to this, during the marker replacement run:
> 
>     [mytag title="Kevin says "hello""]
> 
> The interpolator will find a syntax error in there.
> 
> Example #2: Using the [tmpn] workaround:
> 
>     [tmpn title][item-field title][/tmpn]
>     [mytag title="[scratch title]"]
> 
> The above gets parsed to this, during the marker replacement run:
> 
>     [tmpn title]Kevin says "hello"[/tmpn]
>     [mytag title="[scratch title]"]
> 
> The first line now gets interpolated ok and sets up the "title"
> temporary scratch.  We use [tmpn] because no Interpolation of the
> tag body is required.
> 
> On the second line, the interpolator sets the title argument to
> (literally) [scratch title].  The interpolator spots that the
> argument contains a '[' character and runs a sub-interpolator on
> the argument value.  The value passed into the [mytag] UserTag is
> now the same as the value set in the scratchpad variable and
> everyone's happy.
> 

Excellent and I understand :)  Thanks again for your detailed
information.

-Ron

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.