I think, the section

  # Call this function and include this file after
  #    farmconfig.php, config.php, Group.Page.php and Group.php:
  function MyFunction1($pagename) {...}
  $PostConfig['MyFunction1'] = 25;               # < 50
  $PostConfig["cookbook/some-addon.php"] = 26;   # < 50

should begin with

  # Call this function and include this file before
  #    farmconfig.php, config.php, Group.Page.php and Group.php:

MFWolff January 20, 2018, at 07:05 AM

It is not entirely clear; if you have a better suggestion please edit the page (thanks!). Functions and scripts added to $PostConfig in config.php will be called automatically by PmWiki after config.php. The usual order is as follows: farmconfig.php, config.php, Group.Page.php, Group.php, [$PostConfig<50], stdconfig.php, [$PostConfig>=50], then HandleDispatch() to run the action=edit, diff, browse or other. This makes it possible to configure something in one place, (farm)config.php, then check, revert or add some more configurations after all other configuration and recipes has been loaded. For example, some skins use a different page for AllRecentChanges, and the skin is loaded in stdconfig.php -- if we want to allow multiple skins and all log edits in Site.AllRecentChanges regardless of the skin, we can reset this in a function defined as $PostConfig['MyFunction']=51;. --Petko January 20, 2018, at 07:51 AM

Sorry, Petko, I haven't read the code carefully enough not noticing the following (third) line that says

  #    but before scripts/stdconfig.php:

There is the before I missed. — MFWolff January 21, 2018, at 05:52 AM

You couldn't have noticed it, I added this line to the first example after your question :-) this way is better. --Petko January 21, 2018, at 06:07 AM

To have a preview shown and selecting save and edit add

$_REQUEST['preview'] = 1;

to config.php

Note that it always says "Page is unsaved" even when you have pressed "save and edit". That phrase is in Site.EditForm inside a (:if e_preview:) conditional, which only checks if a preview is requested, not if the page was saved.

This is a talk page for improving PmWiki.LocalCustomizations.