[pmwiki-users] Is it possible to create and use page-scoped variables?

OBUTEX / Hladůvka admin at obutex.com
Fri Apr 7 02:48:20 CDT 2006


Just an idea as I'm not PHP programmer.

What about to deffer properties to "static" performed before
and "dynamic" performed after a cond.markup
then could be
(:property type=static testing true:)  and
(:property type=dynamic message "You don't have permission to edit":)

or another aproach:
the usage of  a property in the cond. markup assumes the property's 
value is allready set.
Usage of the property inside the conditional body block means the 
property is to be
evaluated after evaluating the condition.

Jiri

Patrick R. Michaud napsal(a):
> On Thu, Apr 06, 2006 at 03:13:30PM +0100, Octocias wrote:
>   
>>    Lets say I will refer to a particular URL many times in a wikiPage. If
>>    possible, I'd like to declare a variable at the start of the page with a
>>    string value equal to the URL. Subsequent to that, I can just use the
>>    variable. Also, if the url changes, I can just change the variable at the
>>    top of the page, rather than searching/replacing in the edit box.
>>     
>
> Ah, these are what we've called "page properties" in the past.
> In the past we've discussed the idea of having a (:property:)
> markup  -- i.e., something like:
>
>     (:property home http://www.example.com:)
>
> which could then be later used in the markup as "{$home}" or
> something equivalent.
>
> Unfortunately, there's a bit of a chicken and egg problem that
> hasn't been resolved yet, especially for conditionals and includes.
> For example, some people want to be able to use a property in
> a conditional:
>
>     (:property testing true:)
>
>     (:if {$testing}:)
>     some markup here for testing
>     (:if:)
>
> This implies that the (:property:) and {$...} markups have to be
> performed *before* conditional markup processing.
>
> Other times, people would like to be able to set a property
> inside a conditional:
>
>     (:if auth edit:)
>     (:property message "You don't have permission to edit":)
>     (:if:)
>
>     {$message}
>
> This means that the (:property:) markup has to be performed
> *after* conditional markup processing.
>
> At the moment I don't have a good solution short of a major
> redesign of PmWiki's internal rendering engine, so lacking
> a good solution, I haven't implemented anything here yet.
>
> For version 2.0 there was the Cookbook.Properties recipe, I
> don't know if this recipe will still work under 2.1.
>
> Pm
>
>
>   
>>    On 06/04/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>>
>>      On Thu, Apr 06, 2006 at 02:45:39PM +0100, Octocias wrote:
>>      >    Is it possible to create and use wiki page-scoped variables?
>>
>>      Depends on what you mean by "wiki page-scoped" variables.
>>      Can you give an example?
>>
>>      Pm
>>
>>    --
>>    Octocias
>>    http://www.octocias.com
>>     
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://host.pmichaud.com/mailman/listinfo/pmwiki-users
>
> __________ Informace od NOD32 1.1475 (20060406) __________
>
> Tato zprava byla proverena antivirovym systemem NOD32.
> http://www.nod32.cz
>
>
>
>   

-- 
OBUTEX s.r.o
Ing.Jiří Hladůvka
Zlatovská 22
911 01 Trenčín

tel.: +421 (0)32 6587000
mailto:admin at obutex.com

http://www.obutex.com






More information about the pmwiki-users mailing list