Robin S

Unordered List to Pages: action for Admin Actions

Recommended Posts

Creating a support topic for this action now that the new actions-as-modules feature has been added to Admin Actions.

Unordered List to Pages

An action for the Admin Actions module for ProcessWire CMS/CMF. Creates a structure of new pages from an unordered list entered into a CKEditor field. The nesting of further unordered lists within the list will determine the nesting of the created pages. Created pages get a default template that you select, and you can override this default template per list item by specifying a template name between [[ ]] delimiters.

This action can be useful to quickly create a page structure; especially so if you are rebuilding an existing non-ProcessWire site that has a Sitemap page that you can copy and paste from.

Usage

Install the Unordered List to Pages module.

Visit the Admin Actions config screen and enable the "Unordered List to Pages" action for the roles who are allowed to use it.

Navigate to Admin Actions > Unordered List to Pages and fill out the config fields:

Source

Enter/paste an unordered list in the Source field. There is a "cheatsheet" field above that explains the syntax you can use to set some template options for each list item.

If you want to override the default template for an item you can specify a template name after the page title between double square brackets. If the template doesn't already exist it will be created. Example: Page title [[staff_members]]

You can also specify one or more allowed child templates for a template like so: [[staff_members > manager tech_support]]This would create the page using the staff_members template, and set the allowed child templates of staff_members to manager and tech_support.

Alternatively you can specify one or more allowed parent templates for a template like so: [[manager < staff_members]] This would create the page using the manager template, and set the allowed parent templates of manager to staff_members.

Parent page

Select a parent page that the new pages will be created under.

Default template

Select the default template to use for the new pages.

Screenshots

Action config:

2018-09-28_204032

Result:

2018-09-28_204647

 

https://github.com/Toutouwai/AdminActionsUnorderedListToPages
https://modules.processwire.com/modules/admin-actions-unordered-list-to-pages/

  • Like 7

Share this post


Link to post
Share on other sites

Awesome work Robin - I can see this being my goto approach for quickly getting new site structures up and running! 

  • Like 2

Share this post


Link to post
Share on other sites

v0.1.3 released, with some new features thanks to a request from Adrian.

Any override templates specified in the list items will be created if they don't already exist. You can also set allowed parent templates or allowed child templates for a template within a list item. See the readme or the "cheatsheet" field for the syntax.

  • Like 3

Share this post


Link to post
Share on other sites

Just came here to say that this stuff rocks, @Robin S and @adrian! And looks so awesome in the new admin theme. I know it's nothing really special (for a person spoiled by using PW for a long time), just an import with a UI... But it feels like magic and even cheating))

The new way to add actions to Admin Actions module - a super feature - just a byproduct of this...??!! 😍

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.