[pmwiki-users] Looking for a recipe that creates pages from templates

Simon nzskiwi at gmail.com
Sun Jun 4 22:32:33 PDT 2023


thanks, this sounds very much like what I had in mind.
A drop down list, populated from pagelist like parameters (e.g.
name=*template* or category=template) and $EditTemplatesFmt
<https://www.pmwiki.org/wiki/Cookbook/EditTemplates>, showing the available
template page names and page summaries.
A data entry field for the name of the new page, and a "create" button.
I'll have a play to see  what I can achieve

Simon

On Sun, 4 Jun 2023 at 08:47, Hans Bracker <design at softflow.uk> wrote:

> Hello Simon,
>
> you could probably create a form doing what you want using the Fox
> formprocessing recipe.
> But you are asking for a complex selection process for determining the
> template for the new page.
> A form with a drop-down selection control to choose the right template
> would be the easiest.
> But you are asking for a pre-selection based on evaluating the current
> page name, if i understand you correctly.
> Which means evaluating the page name for some selection criteria must then
> determine the content of further manual selection via a drop-down control
> for instance. To incorporate that into a form gets complicated.
> Possibly use conditional markup within the form to do the pre-selection
> evaluation and show the correct drop-down control for further template
> selection, and having a numb r of those for the various conditional
> requirements (conditions based on page name evaluation).
> Sorry, this is not a solution, just some hints i can think of.
> A simple example to select templates (given on same page in anchored
> sections).
> Conditional pre-selection would still need to be added.
>
> Example for FoxNewPageBox, opens new page in edit mode.
> If page exists it will jump to target page.
> It will load content from a selected template  into the new page.
> Note that here temp1 is the name of the drop-down input selector, and
> template={$FullName}#{$$temp1} will be evaluated when form gets submitted
> to point to selected choice.
>
> (:fox newpageform template={$FullName}#{$$temp1}:)
> Select page template:(:input default temp1 white:)
> (:input select temp1 white:)
> (:input select temp1 green:)
> (:input select temp1 yellow:)
> Name of new page:
> (:input text newedit size=20:)
> (:input submit post "Create Page":)
> (:foxend newpageform:)
> (:if false:)
> [[#white]]
> white page
> [[#green]]
> green page
> [[#yellow]]
> yellow page
> [[#yellowend]]
> (:ifend:)
>
>
>
> cheers,
> Hans
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20230605/5f6ae935/attachment.html>


More information about the pmwiki-users mailing list