Jump to content

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


Goca
 Share

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');
    $bh->postByDate($page);
});

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:

525150447_2021-12-0713_47_19-Window.png.cd514110a61a25a5fa40fd8872341c97.png

Then being presented with the following screen:

657649679_2021-12-0713_47_45-Window.thumb.png.ef7f90a22567d3b9cd96ecc806b7bfdd.png

And finally editing additional page fields after initial page creation:

306916961_2021-12-0713_48_35-Window.thumb.png.6dab4ec7cccaf78c91d2653f3966e8a5.png

 

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.

Thanks!

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...