[pmwiki-users] conditional markup/numbered lists?
Patrick R. Michaud
pmichaud at pobox.com
Wed Feb 23 12:08:47 CST 2005
On Wed, Feb 23, 2005 at 11:51:13AM -0600, Dan Bongert wrote:
> I have a V1 wiki using the IfGroup cookbook recipe. I'm attempting to
> convert to V2, and my current roadblock is this:
>
> In my Main.Sidebar, I have links to my main groups controlled by the
> IfGroup stuff, and both ordered and unordered lists within the IfGroup
> stuff:
>
> =ifgroup GroupOne,GroupTwo,GroupThree **GroupOne/GroupOne
> =ifgroup GroupOne ### GroupOne/PageOne
> =ifgroup GroupOne ### GroupOne/PageTwo
>
> This worked well and good under V1. However, in my attempt to convert
> to V2 syntax, this is as close as I can get:
>
> (:if match ^(GroupOne|GroupTwo|GroupThree)\.:) ### GroupOne/PageTwo
> (:if:)
>
> The actual ###'s get displayed, and not interpreted as markup.
>
> Am I missing something, or is this broken?
Get rid of the space before the ###'s, as it's being interpreted as
part of the markup. Plus, you don't necessarily need the closing (:if:)
for each one -- any (:if ...:) automatically closes the previous one.
Thus:
(:if match ^Group(One|Two|Three)\.:)** GroupOne/GroupOne
(:if match ^GroupOne\.:)### GroupOne/PageOne
(:if match ^GroupOne\.:)### GroupOne/PageTwo
(:if match ^GroupOne\.:)### GroupOne/PageThree
(:ifend:)
Of course, since the ### are all the same condition, you can combine
them into a single (:if...:):
(:if match ^Group(One|Two|Three)\.:)** GroupOne/GroupOne
(:if match ^GroupOne\.:)### GroupOne/PageOne
### GroupOne/PageTwo
### GroupOne/PageThree
(:ifend:)
Hope this is what you're looking for.
Pm
More information about the pmwiki-users
mailing list