[pmwiki-devel] PTVs using MarkupExpr, in a Pagelist

DaveG pmwiki at solidgone.com
Sun Jan 18 22:46:41 CST 2009


I should have included the earlymx markup:
   Markup('{earlymx(', '<{$var}',
     '/\\{earlymx(\\(\\w+\\b.*?\\))\\}/e',
     "MarkupExpression(\$pagename, PSS('$1'))");


DaveG wrote:
> <back on-list>
> Thanks for the response Peter. Changing the parse order seems to work in 
> some cases. Seems to be okay for {$variables} but not {$$variables}.
> 
> Works with {$variables}:
>    var:{earlymx(substr {$FullName} 2 5)}
>    FullName is {$FullName}\\
>    var is {$:var}\\
> 
>    Output:
>    var:ite.B
>    FullName is Site.Blogger-CoreTemplate
>    var is ite.B
> 
> 
> Doesn't work with {$$variables}:
>    var:{earlymx(substr {$$blogid} 2 5)}
>    blogid is {$$blogid}\\
>    var is {$:var}\\
> 
>    Output:
>    var:$blog
>    blogid is blog1
>    var is $blog
> 
> What I'm actually tying to do is get the count of a pagelist, one with 
> embedded variables, so I can use it do determine the total number of 
> pages expected. The pagelist contains PTVs, markup expressions, and 
> {$variables}. Here's an example (the pagelist itself does work):
> 
> (:pagelist wrap=none fmt=#multi-entry-view order=-$:entrydate 
> {(bloggerBlogGroups)} {(bloggerIfVar if blogid {$$blogid})} 
> $:entrytype={$Blogger_PageType_BLOG} {(bloggerIfVar if entrystatus 
> {$$status})} count={$Blogger_EntryStart}..{$Blogger_EntryEnd} :)
> 
> What I actually need is something that will allow processing of PTVs, 
> markup expressions, and {$variables}. Looking at the PmWiki source to 
> determine order processing didn't help me much.
> 
>   ~ ~ David
> 
> Peter Bowers wrote:
>> I didn't notice if your question had already been answered (seeing as I'm
>> about 5 days late) so I'll answer off-list.
>>
>> The problem, as you correctly surmised, is the MXs typically get processed
>> much later than PTVs.  The way I got around this was {earlymx{...}) which is
>> exactly like a normal MX but gets processed way earlier.  You can see it in
>> WikiSh.php if you're interested, but probably this brief explanation
>> suffices.
>>
>> -Peter
>>
>>> -----Original Message-----
>>> From: pmwiki-devel-bounces at pmichaud.com [mailto:pmwiki-devel-
>>> bounces at pmichaud.com] On Behalf Of DaveG
>>> Sent: Saturday, January 10, 2009 8:19 PM
>>> To: PmWiki Devel
>>> Subject: [pmwiki-devel] PTVs using MarkupExpr, in a Pagelist
>>>
>>> I'm trying to declare a PTV, based on the result of a Markup Expression.
>>> The ME resolves correctly, but displaying the value of the PTV and I get
>>>   a fragment of the ME.
>>>
>>> Pagelist:
>>> (:template each:)
>>> x:{(bloggerBasePage {=$FullName})}\\
>>> x is {$:x}\\
>>>
>>> Output:
>>> x:MyGroup/BasePageName
>>> x is {=$FullName}
>>>
>>> Is the problem simply that ME gets resolved too late to assign to a PTV,
>>> or do I have a variable reference wrong?
>>>
>>>   ~ ~ Dave
>>>
>>> _______________________________________________
>>> pmwiki-devel mailing list
>>> pmwiki-devel at pmichaud.com
>>> http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
>>
> 
> _______________________________________________
> pmwiki-devel mailing list
> pmwiki-devel at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
> 



More information about the pmwiki-devel mailing list