Recent Changes - Search:

add Cookbook page







Visitor's book Site map pmwiki-2.3.2

Messages Replacement

MessagesReplacement version 2022-02-22

Summary: A drop in replacement for the PmWiki (:messages:) directive
Version: 2022-012-02
Prerequisites: PmWiki 2.2.131 (PHP 7.4 compatible)
Status: beta
Maintainer: skiwi
Licence: GPL3#
Users: (view / edit)

Questions answered by this recipe

Can I display selected debugging messages from $MessagesFmt from only one message source.


A drop in replacement for the PmWiki (:messages:) directive. Based on code from PITS:01368.

Differences are:

  • comma or space separated parameters, with wildcards, can be supplied
  • only messages for specified parameters are displayed
  • parameters are case insensitive
  • directive does not have to start at the beginning of a line
  • placed within a HTML section of class=messages



Place the directive, as described below, in your PmWiki page.

The recipe provides a page variable {$MessagesReplacementVersion} which contains the current version, and page variable $MessagesReplacement for a (:if enabled MessagesReplacement:) recipe installation check.


(:messages optional,list,of,names :)

  • parameters are optional and case-insensitive.
  • names can include wild cards

config.php settings

You can change the following in config.php. For example

$MessagesReplacementDebug = true; # results may vary
default: false
$MessagesReplacementHeading = true; # shows heading level 3 for each group of messages
default: false

Change log / Release notes

2022-02-02 Separate groups of messages, enable heading 2022-01-22 Initial version

See also


Special thanks to Petko


See discussion at MessagesReplacement-Talk

Page last modified on 2022 Feb 08 09:04

Edit - History - Recent Changes - WikiHelp - Search - (:messages:) -> mailto:?Subject=KiwiWiki: Messages Replacement&Body=From KiwiWiki: Messages Replacement (https://kiwiwiki [period] nz/pmwiki/pmwiki [period] php/Cookbook/MessagesReplacement) - A drop in replacement for the PmWiki [[PmWiki:PageDirectives#message directive|email page as link]]