EditForm Custom Fields
Questions answered by this recipe
Can I have a 'Title' input field in the edit-form of PmWiki rather than needing to mention the title of a page inside the
title ...:) markup?
Can I edit a page's 'ctime' (creation time) property from the edit-form of PmWiki? (PmWiki 2.1.beta15 or higher)
Can I edit the existing attributes (like 'title','ctime','author','host',etc.) or add additional attributes to a page from PmWiki's edit-form instead of needing to manually modify the files in wiki.d folder?
Ans: Yes, you can using this recipe. The first two features are provided out-of-the box by this recipe. This enables mentioning the title of a page in a separate input field rather than in the
title ...:) markup. Also enables changing the value of a page's 'ctime'. The third feature (adding additional attributes) requires customization of the recipe to include more customized properties and fields in the edit-form.
Using this recipe you can add "Title", "Creation Date", etc. custom input fields to the edit form of PmWiki. This enables mentioning the title of a page in a separate input field rather than in the <code class='escaped'>(:</code><code class='escaped'>title ...:)</code> markup within the wiki-text. Also enables changing the value of a page's 'ctime'. The recipe can be customized to include more fields.
- Download the attached editformcustomfields.phpΔ(check file consistency) file and place it in the cookbook/ folder.
- In /local/config.php add the line
- Edit the EditForm (generally the page Site.EditForm) to include
(:input e_ctime:)where you want the fields to appear.
PHP variables: The following PHP variables may be set on config.php
| ||An array indicating which custom input fields are active.|| |
| ||The date-time format to be used to display and input 'ctime'.|| |
Adding custom fields:
This needs editing of
editformcustomfields.php.To add another property (existing or customized), copy one of the 'if' blocks in
editformcustomfields.php and customize it as desired. Remember to add the corresponding entry in $customFields_isActive.
The future versions will have more friendly ways of adding new/custom fields other than 'title' and 'ctime'.
2010-01-27: v1.0 released.
2012-03-15: v1.01 released. Fixed an incompatibility bug. See http://thread.gmane.org/gmane.comp.web.wiki.pmwiki.user/59673 for details on the bug.
If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".
- Subhrajit -- author
This space is for User-contributed commentary and notes. Please include your name and a date (eg 2007-05-19) along with your comment. Optional alternative: create a new page with a name like "ThisRecipe-Talk" (e.g. PmCalendar-Talk).
See discussion at EditFormCustomFields-Talk