seddass Posted October 8, 2011 Share Posted October 8, 2011 Hi, all. Sorry if this is already mentioned somewhere but i couldn't find it in the forum. There was an issue when clients updates the "title" field but forgot to update the "name" field. I think I have saw a way to move the "name" field from Settings to Content tab with a checkbox somewhere in template settings. Now it is gone. Is it still possible? Thanks in advance. P.S. I agree that it is not goot to change the page urls. Link to comment Share on other sites More sharing options...
ryan Posted October 8, 2011 Share Posted October 8, 2011 Edit your /site/config.php and locate the line that says $config->advanced = false; Change it to true. Now when editing our template, you'll see a "system" tab. Click on that tab and check the box that says to show the name field on the content tab. Save. Your name field should now show on the content tab for pages using that template. You don't want to keep $config->advanced on as it's meant for PW core/system development rather than regular development, and it can get you in trouble (I always keep it off unless I need something in it temporarily). So go back immediately and edit your /site/config.php and set advanced back to false. 1 Link to comment Share on other sites More sharing options...
seddass Posted October 8, 2011 Author Share Posted October 8, 2011 Oh, yes. Thank you! Link to comment Share on other sites More sharing options...
apeisa Posted October 8, 2011 Share Posted October 8, 2011 Btw is it planned to have access management per tab? I remember Ryan mentioned that per field access management is coming (it would allow great workflows etc) and I assume that this would allow us to have per tab management too? (at least for custom tabs, but how about settings tab?) Link to comment Share on other sites More sharing options...
ryan Posted October 10, 2011 Share Posted October 10, 2011 I hadn't planned on per-tab access control, though I suppose it would make sense with field-level access control since tabs are defined as fields containing other fields. Items under children, settings and delete already have granular access control, so worry a little about confusion from bringing in tab access control. But will give this more thought and consideration as we get into development of field-level access control. Link to comment Share on other sites More sharing options...
apeisa Posted November 4, 2011 Share Posted November 4, 2011 Edit your /site/config.php and locate the line that says $config->advanced = false; Change it to true. Now when editing our template, you'll see a "system" tab. Click on that tab and check the box that says to show the name field on the content tab. Save. Your name field should now show on the content tab for pages using that template. How to do this from API? Need this in one module I am building. Link to comment Share on other sites More sharing options...
Soma Posted November 4, 2011 Share Posted November 4, 2011 How to do this from API? Need this in one module I am building. $tmpl->nameContentTab = 1; Link to comment Share on other sites More sharing options...
apeisa Posted November 4, 2011 Share Posted November 4, 2011 Ahh.. I actually totally misunderstood that quote from Ryan What I need to do is to add new fields to settings tab. Is that currently possible? EDIT: And thanks and [applaud] Soma! You are so helpful that I am beginning to think your help as granted... Link to comment Share on other sites More sharing options...
Soma Posted November 4, 2011 Share Posted November 4, 2011 You're welcome, glad if I can help. Thanks for the applaud 8) Not sure what exactly you want to archive... on template settings tab? I remember a related subject in this thread first page... http://processwire.com/talk/index.php/topic,414.0.html Link to comment Share on other sites More sharing options...
apeisa Posted November 4, 2011 Share Posted November 4, 2011 I am adding new field to a template, but would love to have it under settings tab when editing page, instead of content or custom tab. Link to comment Share on other sites More sharing options...
ryan Posted November 4, 2011 Share Posted November 4, 2011 To add something to the settings tab, hook into ProcessPageEdit::buildFormSettings It returns an InputfieldWrapper that you can append() or prepend() fields, or you can even do something like this: <?php $wrapper = $event->return; $templateField = $wrapper->get('template'); $myField = wire('modules')->get('InputfieldText'); $myField->attr('name', 'hello'); $myField->label = "Hello there"; $wrapper->insertAfter($myField, $templateField); $event->return = $wrapper; But I think it's better to just append or prepend to the the wrapper, because you don't really know for sure which fields will be active on the settings tab. Also note that on some pages, there is no settings tab. Link to comment Share on other sites More sharing options...
peterfoeng Posted May 9, 2014 Share Posted May 9, 2014 Hi,I am wondering if we can also we move the fields on the template (global field) to the settings tab. I am having a bit of issue understanding of what needs to be done. /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { // add a 'hello' method to every page that returns "Hello World" $this->addHookAfter('ProcessPageEdit::buildFormSettings', $this, 'example'); } public function example($event) { $page = $event->object->getPage(); $form = $event->arguments("form"); echo $page->template; print_r($form); $wrapper = $event->return; $templateField = $wrapper->get('template'); $myField = wire('modules')->get('InputfieldText'); $myField->attr('name', 'hello'); $myField->label = "Hello there"; //$wrapper->insertAfter($page->get('title'), $templateField); $event->return = $wrapper; } Can this be done? I wonder Thanks Link to comment Share on other sites More sharing options...
Martijn Geerts Posted May 9, 2014 Share Posted May 9, 2014 You've to use a 'lower' hook: $this->addHookAfter("ProcessPageEdit::buildForm", $this, "example"); // From there you can find all tabs // settings tab $settings = $form->find("id=ProcessPageEditSettings")->first(); // content tab $content = $form->find("id=ProcessPageEditContent")->first(); // view tab $view = $form->find("id=ProcessPageEditView")->first(); 1 Link to comment Share on other sites More sharing options...
Can Posted July 21, 2014 Share Posted July 21, 2014 Think I misunderstood something. Enabled $config->advanced and thought I will see all fields and tabs (maybe as fieldgroups) within template field chooser/rearranger so I can manage them like any other field or fieldgroup. Wanted to move the page status fieldgroup to the bottom of the content tab to make it a little clearer. I know it would work with a hook, but thought if possible with congif->advanced why use a hook when I can have drag'n'drop fun Link to comment Share on other sites More sharing options...
bernhard Posted February 24, 2016 Share Posted February 24, 2016 is it possible to change the position, name + description of the field after moving it to content tab? Link to comment Share on other sites More sharing options...
LostKobrakai Posted February 24, 2016 Share Posted February 24, 2016 I'd say with hooks it should be possible. Link to comment Share on other sites More sharing options...
bernhard Posted February 24, 2016 Share Posted February 24, 2016 ok i wanted to make sure that i did not miss any settings only visible when doing additional things like "show also system fields" and so on... i guess hooking into buildform and then something like that: https://processwire.com/talk/topic/5294-field-columnwidth-via-api/?p=50948 ? will try that later Link to comment Share on other sites More sharing options...
adrian Posted February 24, 2016 Share Posted February 24, 2016 ok i wanted to make sure that i did not miss any settings only visible when doing additional things like "show also system fields" and so on... i guess hooking into buildform and then something like that: https://processwire.com/talk/topic/5294-field-columnwidth-via-api/?p=50948 ? will try that later If you can't get that to work, you could try adding a dedicated field to the content tab and adding a save hook to take it's value, sanitize it as a page name and then use it to populate the page name. I am also curious as to your reasoning for this - if it's to make it easier for editors to remember to update it, then maybe you should just install https://processwire.com/talk/topic/7724-page-rename-options/ - even if it's only installed during development of the site, and then uninstalled once live to protect URLs from changing automatically? 1 Link to comment Share on other sites More sharing options...
bernhard Posted February 24, 2016 Share Posted February 24, 2016 thank you adrian, that's a good idea and i would definitely be able to do that. i'll try the other way first to learn a different approach. the reason is related to this post: https://processwire.com/talk/topic/10804-module-runtimemarkup-fieldtype-inputfield/?p=114147 i have a button that does some additional logic on page copy (copy the event but remove all available bookings). after copy the new page has a path like "event-1". i don't think that my client will find his way into the settings tab so i put it in the content tab and it is the first thing he sees after the copy. but its only a workaround for the linked post... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now