[pmwiki-users] Conditional Content based on pagelist.

Mark Bacas mbacas at gmail.com
Sun Mar 14 17:22:34 CDT 2010


Thanks! That works but I was hoping to use the same template and just
change the header.

%purple%'''Open Developer Support Issues'''
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:context=dev,
$:status=open:)

%green%'''Open Partner Portal Issues'''
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:context=partner,
$:status=open:)

%navy%'''Open Developer Portal Issues'''
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=open,
$:status=-closed, $:context=devport:)

%red%'''Open ECRs'''
(:pagelist fmt=#GTDlist order=$:ID
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=open,
$:status=-closed, $:context=ecr:)

Could I handle this with page variables somehow?

(:SectionHeader: %navy%'''Open Developer Portal Issues''':)
(:pagelist fmt=#GTDlist order=-time
group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:status=open,
$:status=-closed, $:context=devport:)

and this in my template:
[[#GTDlist]]
(:template first:)
{{=$FullName}$:SectionHeader}
(:if equal {<$Group}:)

but that doesn't seem to be working.

 - Mark

On Sat, Mar 13, 2010 at 5:23 AM, Peter Bowers <pbowers at pobox.com> wrote:
> On Fri, Mar 12, 2010 at 7:45 PM, Mark Bacas <mbacas at gmail.com> wrote:
>>
>> I have the below on a page in my system:
>>
>> =================================
>> %green%'''Open Partner Portal Issues'''
>> (:pagelist fmt=#GTDlist order=-time
>> group=GTD.2010*,-GTD.GTD,-GTD.RecentChanges $:context=partner,
>> $:status=open:)
>> =================================
>>
>> I'd like it If the pagelist ends up not containing any pages to not
>> display this section at all.
>>
>> Right now, I end up with a green "Open Partner Portal Issues" header
>> but nothing under it. I only want the heading to show up if there is
>> content to display under it.
>
> Put the line
>
> %green% Open Partner Portal Issues%%
>
> in a (:template first:) section in your PageListTemplate.  You can
> also use (:template none:) if you want to display something else when
> no pages match.  See this page:
>
> http://www.pmwiki.org/wiki/PmWiki/PageListTemplates
>
> For more detail on putting together these templates.  Note that it's a
> good idea to put any modified templates in the current page or
> Site.LocalTemplates so they don't get over-written in
> Site.PageListTemplates when you do an upgrade.
>
> -Peter
>



More information about the pmwiki-users mailing list