[pmwiki-devel] understanding pagelist default parameters

Petko Yotov 5ko at 5ko.fr
Fri Mar 20 00:14:20 PDT 2026


The argument category= without anything after the "=" is considered a 
search string and the pagelist shows pages containing the literal string 
"category=" in the page text.

You can use category="" but this overrides your template default.

If you populate this argument from a page text variable, there are 
$DefaultEmptyPageTextVars and $DefaultUnsetPageTextVars:

   $DefaultUnsetPageTextVars['genre'] = '*';
   $DefaultEmptyPageTextVars['genre'] = '*';

This should work for the pagelist argument, but may not work well if you 
display the {*$:genre} variable elsewhere.

Otherwise you could have a conditional with 2 pagelists, something like 
this:

(:if332 empty "{*$:genre}":)
(:pagelist ... category=*:)
(:else332:)
(:pagelist ... category="{*$:genre}":)
(:if332end:)

Petko

-- 
If you upgrade :  https://www.pmwiki.org/Upgrades

On 20/03/2026 06:27, Simon wrote:
> I have a test here:
> https://www.pmwiki.org/wiki/Test/PagelistWithCategoryParameter
> 
> It has defaults, viz
> 
> (:template defaults group=Cookbook order=name category="*" count=5 :)
> 
> I'm trying to understand why
> (:pagelist name=W* fmt={$FullName}#listbyletter :)
> appears to give a different result from
> 
> (:pagelist name=W* fmt={$FullName}#listbyletter category= :)
>  thanks
> 




More information about the pmwiki-devel mailing list