Jump to content

Add more fields to "Add Page" for particular page type?


Recommended Posts

Hi there,

I am creating a blog system, and I currently have a setup where I have blog-homeblog-yearblog-section, and blog-post as templates. I have created a blog-drafts template, which is where blog-post templates will be created, and then I have the following hook that has some basic logic to check for an appropriate blog-year and blog-section page group to set as the post parent (such as 2021/12):

// Blog Post handler to place blog post into appropriate blog section based on date
$this->addHookBefore('Pages::published(template=blog-post)', function(HookEvent $event) {
    $pages = $event->object;
    $page = $event->arguments(0);

    $bh = wire('modules')->getModule('BlogHelper');

All of this is working perfectly, however there's 1 step that's lacking to really streamline the whole process, and that's the first "Add Page" step that simply requires "Title" and "Name." Starting from creating a new page via the "Add New" dropdown using a Bookmark:


Then being presented with the following screen:


And finally editing additional page fields after initial page creation:



Is there any way to cut out the second step and just set all page details right away? I would love to be able to streamline this for our blog editor so that he can just click "Add New -> Blog Post ..." and then set all details for the post from there.


Link to comment
Share on other sites

Wow, that was way easier than I expected. I must have been typing the wrong search terms in, and still new to ProcessWire so reading through documentation as I go along, but wasn't sure how to find this in particular.

Thank you for the help! 🙂

  • Like 1
Link to comment
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.
  • Create New...