Jump to content

Move fields from "Settings" tab to "Content" tab in the Page Editor?


Recommended Posts

Posted

This is officially my second day trying to understand ProcessWire and all its awesome awesomeness.

Two things I love about it so far:  [1] Truly unlimited custom fields and [2] Ability to easily customize the layout of said custom fields inside the admin panel.

That being said, I would like to move the Name and Status fields from the Settings tab to the Content tab.  In fact, if there's a way to re-order and resize the fields, I wouldn't mind deleting the Settings tab entirely and moving ALL those fields to the Content tab.

I found an old 2011 discussion related to this, but Ryan's answer seems to be obsolete now.

Any ideas how to tackle this?

Posted

Check out advanced mode in config.php and you'll have this for each template:

Screen Shot 2016-07-17 at 4.28.42 PM.png

Maybe doesn't take care of everything you need, but remember that the status can also be changed from the Page List view via the extended (after the arrow) action buttons.

  • Like 5
Posted
40 minutes ago, adrian said:

Check out advanced mode in config.php and you'll have this for each template:

Maybe doesn't take care of everything you need, but remember that the status can also be changed from the Page List view via the extended (after the arrow) action buttons.

Thank you, Adrian.  I checked and rechecked my config.php file for that setting.  Couldn't find it.  I didn't realize there are 2 different config files.  Ha!  (for anyone else reading this, the Advanced Mode setting is in the /wire/ directory, not /site/.)

Your screenshot was very helpful.

Also, I didn't know about the hidden status/unpublish buttons on the Page List View.  That's a great time saver!  Thanks for the tip.

  • Like 1
Posted

You can and should add the option in the config file inside your site directory.

The wire/config.php has the defaults and the site/config.php has your custom config which overrides the wire ones.

  • Like 3
Posted
8 minutes ago, JMartin said:

Thank you, Adrian.  I checked and rechecked my config.php file for that setting.  Couldn't find it.  I didn't realize there are 2 different config files.  Ha!  (for anyone else reading this, the Advanced Mode setting is in the /wire/ directory, not /site/.)

No problem - actually, you don't want to modify the wire/config.php - you just use that as a reference and copy any options you want from it to the site/config.php and modify as required.

 

8 minutes ago, JMartin said:

Also, I didn't know about the hidden status/unpublish buttons on the Page List View.  That's a great time saver!  Thanks for the tip.

BatchChildEditor module is also helpful if you need to make changes to lots of child pages at once.

EDIT: Beaten by @fbg13

  • Like 2
Posted
2 minutes ago, fbg13 said:

You can and should add the option in the config file inside your site directory.

The wire/config.php has the defaults and the site/config.php has your custom config which overrides the wire ones.

1 minute ago, adrian said:

No problem - actually, you don't want to modify the wire/config.php - you just use that as a reference and copy any options you want from it to the site/config.php and modify as required.

 

BatchChildEditor module is also helpful if you need to make changes to lots of child pages at once.

Oh geez.  Of course, I didn't know that.  

Now I see that warning at the top of the /wire/config.php file.   Appreciate the heads up. 

 

  • Like 1
Posted
43 minutes ago, adrian said:

BatchChildEditor module is also helpful if you need to make changes to lots of child pages at once.

Wow.  That's fantastic.  Just installed and worked through the options.  I think I mostly understand it.  Seems extremely powerful.  Thank you for making it!

On a related note... your ProcessPageFieldSelectCreator module was instrumental in me *finally* understanding how Pages work!  Specifically... that they're not just "pages."  With much frustration, I almost gave up on PW several times yesterday because it just wasn't making any sense.  But experimenting with your module provided me with a much-needed light bulb moment.  After that, a lot of stuff has 'clicked' for me.

So thank you again.

 

  • Like 2
Posted

Glad you are finding those modules so useful - especially the page select creator - it is definitely a time saver - it can be a little time consuming and confusing to get the template parent/child permissions correct.

  • Like 1
  • 8 years later...
Posted

Needed this today. This is what I used:

<?php
// on init of a module
wire()->addHookAfter('ProcessPageEdit::buildForm', $this, 'moveStatusFieldAndHideSettings');

// the hook method
protected function moveStatusFieldAndHideSettings(HookEvent $event): void
{
  // do not change the UI for superusers
  if (wire()->user->isSuperuser()) return;
  
  /** @var ProcessPageEdit $process */
  $process = $event->process;
  $p = $process->getPage();

  // check for page template
  if (!$p->matches('template=basic-page')) return;

  // get status field
  /** @var InputfieldWrapper $form */
  $form = $event->return;
  $statusField = $form->get('status');

  // add field to content tab
  $tab = $form
    ->find("id=ProcessPageEditContent")
    ->first();
  if (!$tab) return;
  $tab->add($statusField);

  // remove settings tab both from form and from UI
  $tab = $form
    ->find("id=ProcessPageEditSettings")
    ->first();
  if (!$tab) return;
  $form->remove($tab);
  $process->removeTab('ProcessPageEditSettings');
}

 

  • Like 2

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
×
×
  • Create New...