[pmwiki-devel] Puzzled about pagelists returning search results

Petko Yotov 5ko at 5ko.fr
Sun Oct 25 10:53:11 PDT 2026


On 21/10/2026 21:34, Simon wrote:
> I'm, wondering if perhaps (:template defaults request=-group req=1
> 
> does not work?

Indeed, the attributes req= and request= should be added to the 
(:pagelist:) directive, not to a (:template default:) directive.

They are handled early, before the pagelist "template default" are 
parsed.

If there is req= at that early time and there is no search query 
(?q=term in the URL), the function exits at that point, it doesn't load 
the templates.

Similarly for request=, the pagelist attributes like 
request=group,fmt,order , that are derived from the $_REQUEST array, are 
also merged early. If there are request= attributes in "template 
default", these are ignored.

It always behaved in this order. If we change the order and handle these 
after "template default" is parsed, it may break something else.

We should document this clearly.

Petko

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



More information about the pmwiki-devel mailing list