[pmwiki-users] Disabling header, sidebar, and footer...

Petko Yotov 5ko at 5ko.fr
Mon Nov 21 06:25:08 PST 2022


Follow-up on an older thread:

Adding (:noheader:) and (:noleft:) to templates, service pages and pages 
included by the skin should finally work as one would expect with the 
next PmWiki version 2.3.16 (next month).

As usual, this can be tested now with the pre-release which can be 
downloaded from the ChangeLog page, or via subversion.

Petko

On 04/11/2022 13:43, Petko Yotov wrote:
> I suspect (:nofooter:) works. You can add this to your config.php:
> 
>   $AuthPromptFmt = array('markup:(:noheader:)(:nofooter:)(:noleft:)',
>          &$PageStartFmt, 'page:$SiteGroup.AuthForm',  &$PageEndFmt);
> 
> 
> The design of the PrintFmt() function is that once output to the
> browser starts, if an included or processed page adds or disables some
> features like the header or footer, those that have already been sent
> to the browser cannot be removed, but those that follow can.
> 
> The code above ensures the markup '(:noheader:)(:nofooter:)(:noleft:)'
> will be processed before the header and sidebar are sent to the
> browser.
> 
> 
> Adding '(:noheader:)(:nofooter:)(:noleft:)' to Site.AuthForm will fail
> for the header and probably for the sidebar (unless in the skin
> template, the sidebar is after the page text), but will succeed
> disabling the footer.
> 
> This also happens if a SideBar adds some recipe that injects some
> JavaScript or styles in the HTML header -- the header is already sent
> when the SideBar is processed.
> 
> 
> PrintFmt() accepts nested arrays and processes them recursively. Every
> element of the array can be either another array, HTTP headers, HTML,
> wiki markup, a wiki page, or a function, and all these can potentially
> enable or disable skin parts, styles, scripts, or HTTP headers.
> 
> There is no simple fix, I'll have to think about it, but should be 
> doable.
> 
> 
> Petko



More information about the pmwiki-users mailing list