CleanupRe: PITS.00957?. This page is quite good for pmwiki.org, but unfortunately many examples will not work out of the box on another server - there will be no Cookbook/ or PITS/ WikiGroups. We need to refactor this page in order for it to be useful on remote servers. —Petko? July 11, 2009, at 10:40 PM Other information:
Usage notesLists can be separated with leading spaces (a la Site.Blocklist? or Site.InterMap)
Lists can have leading or trailing spaces around the page variable name
What you can’t doMismatch case in the page variable name
Have embedded (you really didn’t expect that did you) spaces in the page variable name
Note that leading and trailing spaces in the page variable text are retained
Use natural page names, ie normal page name preprocessing does not occur
Use with conditional markup
Can’t you? —Eemeli Aro? July 28, 2009, at 06:22 AM
See more examples at Test.Ptv? Usage in code
SDVA($PageTextVarPatterns, array( 'var:' => '/^:*\\s*(\\w[-\\w]*)\\s*:[ \\t]?(.*)$/m', '(:var:...:)' => '/\\(: *(\\w[-\\w]*) *:(?!\\))\\s?(.*?):\\)/s')); QuestionsQHow can I get the page text variable to be evaluated only when it is declared, rather than each time it is used? For example I want to do the following, where the link refers back to the page with the included text (:Abstract:{Programme.Abstracts$RandomSection}:) (:include {$:Abstract} lines=4:) ->[[{$:Abstract} | more ...]]
QIs there a way to overwrite Page text variables, for including the same Template twice? E.g.: (:parameter:value1:) (:include TemplateThatUsesParameter:) (:parameter:value2:) (:include TemplateThatUsesParameter:) See Include with PTV?, IncludeWithPTV2? It is possible to enable PTV definition in bulleted lists by entering this line in config.php $PageTextVarPatterns[‘* var:’] = ‘/^(\\**\\s*(\\w[-\\w]*)\\s*:[ \\t]?)(.*)($)/m’; Thanks to EemeliAro? (from the Mailing list). QIs it possible to use complex searches for PTV through pagelist? For example using regexp like this: (pagelist $MyVar=“<regexp match pattern>”)? Maybe a cookbook recipe can be provided for this? Also is there a possibility to achieve complex pagelist searches based on PTV-match conditions? For example to search for all pages where PTV1=<xxx> | PTV2!=<yyy>, or some other boolean expression… I wonder if this is something that can be cookbooked? QIs there any possibillity to include PageTextVariables in some other MarkUp? Something like that: (:div id={{=$Name}$:project}}_small :) Yes. Inspect the source to see that the following works. —Eemeli Aro? July 28, 2009, at 06:29 AM
This is a talk page for improving PmWiki.PageTextVariables. |