|
Cookbook /
SpacedWikiWordsGoalSpace out WikiWords in the page presentation without requiring FreeLink? mark-up. This recipe is obsoleted by $SpaceWikiWords and the (:spacewikiwords:) directive.
SolutionPut spaced.php in the PmWiki cookbook/ directory (you may have to create it). Add the following line to local/config.php: include_once("cookbook/spaced.php");
DiscussionWhen using a PmWiki as a website authoring tool, it's often desirable to present page names in a format that doesn't look "wikiish" by spacing out page names represented by WikiWords. Bare WikiWords will generate links to their associated pages, but the link text may appear odd to those unfamiliar with wikis. To address this space can be added between the individual components of a wiki word. This can be accomplished by using FreeLinks and adding the text of the WikiWord spaced out in the link text, but this is a bit tedious when editing (requiring that the page name be entered twice. To avoid this, this cookbook solution adds code to automatically space out the link text of WikiWord links and provides a function that can be used in PmWiki page layout templates to space out PmWiki global variables holding WikiWord text. Usage NotesWikiWord link text is automatically spaced out (for both existing and nonexisting wiki pages). So no specific action is required to make this happen once the spaced.php cookbook file is included in the local config.php file. To display spaced out WikiWord text in your skins template use the following mark-up in the .tmpl file <!--function:TmplSpacedWikiWord [WikiWord]--> where To space page names in the Group / Name page title, try the following:
That will probably work... - but that don't - PRZ - Contributor |