<div dir="ltr">Thankyou, I now see the problem (I think?)<br><br>I would have expected, say, in this statement (from a SideBar)<br>(:pagelist name=A* fmt=Songbook.SideBar#listbyletter category={*$:genre} :)<br><div>the parameter category= NOT to morph into a search string if the page text variable {*$:genre} is not defined on a page body.</div><div><br>It seems to me that if a user desires a search string of "category=" they should quote it.<br><br>thanks<br><br>Simon<br><br><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, 20 Mar 2026 at 20:14, Petko Yotov <<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The argument category= without anything after the "=" is considered a <br>
search string and the pagelist shows pages containing the literal string <br>
"category=" in the page text.<br>
<br>
You can use category="" but this overrides your template default.<br>
<br>
If you populate this argument from a page text variable, there are <br>
$DefaultEmptyPageTextVars and $DefaultUnsetPageTextVars:<br>
<br>
$DefaultUnsetPageTextVars['genre'] = '*';<br>
$DefaultEmptyPageTextVars['genre'] = '*';<br>
<br>
This should work for the pagelist argument, but may not work well if you <br>
display the {*$:genre} variable elsewhere.<br>
<br>
Otherwise you could have a conditional with 2 pagelists, something like <br>
this:<br>
<br>
(:if332 empty "{*$:genre}":)<br>
(:pagelist ... category=*:)<br>
(:else332:)<br>
(:pagelist ... category="{*$:genre}":)<br>
(:if332end:)<br>
<br>
Petko<br>
<br>
-- <br>
If you upgrade : <a href="https://www.pmwiki.org/Upgrades" rel="noreferrer" target="_blank">https://www.pmwiki.org/Upgrades</a><br>
<br>
On 20/03/2026 06:27, Simon wrote:<br>
> I have a test here:<br>
> <a href="https://www.pmwiki.org/wiki/Test/PagelistWithCategoryParameter" rel="noreferrer" target="_blank">https://www.pmwiki.org/wiki/Test/PagelistWithCategoryParameter</a><br>
> <br>
> It has defaults, viz<br>
> <br>
> (:template defaults group=Cookbook order=name category="*" count=5 :)<br>
> <br>
> I'm trying to understand why<br>
> (:pagelist name=W* fmt={$FullName}#listbyletter :)<br>
> appears to give a different result from<br>
> <br>
> (:pagelist name=W* fmt={$FullName}#listbyletter category= :)<br>
> thanks<br>
> <br>
<br>
</blockquote></div>