kixe Posted December 22, 2015 Share Posted December 22, 2015 I was looking for a more comfortable solution to add pages from a PageField Select. I ended up in this small module. Which is quite simple, but very useful. I created a PageField and another field of Type AddPage (requires FieldtypePageTable) with same settings for template and parent. Now I can easily add the page in the Modal.If you need it, take it as a Christmas Present from my side. (no christmas smiley available ... )Dear Ryan, dear community, I wish you all the best for christmas and the upcoming year. <?php /** * Excellent side dish to Fieldtype Page. Doesn't store any data. Provides comfortable page creation. * * made by kixe (Christoph Thelen) 22.12.15 * Licensed under GNU/GPL v3 * * ProcessWire 2.x * Copyright (C) 2015 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://processwire.com * * */ class FieldtypeAddPage extends FieldtypePageTable implements Module { public static function getModuleInfo() { return array( 'title' => 'Fieldtype Add Page', 'version' => 100, 'summary' => 'Excellent side dish to Fieldtype Page. Doesn\'t store any data. Provides comfortable page creation.', 'author' => 'kixe', 'requires' => 'FieldtypePageTable' ); } public function init() { // prevent data storage $this->addHookAfter('FieldtypePageTable::sleepValue', function($event) { $event->return = array(); }); // unneeded configuration fields can be removed $this->addHookAfter('FieldtypePageTable::getConfigInputfields', function($event) { $inputfields = $event->return; $page_behavior = $inputfields->children()->get(2); $removes = array('sortfields','trashOnDelete','unpubOnTrash','unpubOnUnpub',$page_behavior); foreach ($removes as $remove) $inputfields->remove($remove); $event->return = $inputfields; }); } } Screencast 12 Link to comment Share on other sites More sharing options...
bernhard Posted December 23, 2015 Share Posted December 23, 2015 hey kixe, also the best wishes to you would you mind doing a short screencast so that we do not have to install it, create the fields etc... http://www.cockos.com/licecap/ is a cool small tool to do that in seconds on win/osx. it creates a GIF so you don't even have to upload it to youtube or the like. just record and post it directly here in the forum. thank you for sharing your module 13 Link to comment Share on other sites More sharing options...
kongondo Posted December 23, 2015 Share Posted December 23, 2015 http://www.cockos.com/licecap/ is a cool small tool to do that in seconds on win/osx. it creates a GIF so you don't even have to upload it to youtube or the like. just record and post it directly here in the forum. OT: I have been meaning to ask you how you do your cool animated GIFs. Thanks! Link to comment Share on other sites More sharing options...
bernhard Posted December 23, 2015 Share Posted December 23, 2015 Credits go to tpr but I think the forum could profit if we spread the word and more people used it to show their work. I think it's the most efficient way to show modules/features and so on 1 Link to comment Share on other sites More sharing options...
kixe Posted January 4, 2016 Author Share Posted January 4, 2016 added a screencast. 1 Link to comment Share on other sites More sharing options...
mr-fan Posted January 4, 2016 Share Posted January 4, 2016 Looks great but, could you run a pagereload on saving the modal via JS? So the option is already there. Users are most not very familiar with browser reloading (having a actual problem with some UI things that users don't get with pagetables...and modals...and saving Very good improvment so far! Best regards mr-fan 1 Link to comment Share on other sites More sharing options...
horst Posted January 4, 2016 Share Posted January 4, 2016 What's about not yet saved content in other fields when reloading? Will this get saved first? Also, is it good to save (optionally massive) changes without the knowing of the user? At least, I think it only could be an option, not the default. 1 Link to comment Share on other sites More sharing options...
bernhard Posted January 4, 2016 Share Posted January 4, 2016 Thank you for the screencast kixe! Isn't it doing the same like the awesome https://processwire.com/talk/topic/9857-module-page-field-edit-links/ ? 1 Link to comment Share on other sites More sharing options...
kixe Posted January 4, 2016 Author Share Posted January 4, 2016 @BernhardB Thanks. I didn't know about that. Obviously it is doing the same job. 1 Link to comment Share on other sites More sharing options...
bernhard Posted January 4, 2016 Share Posted January 4, 2016 i'm sorry for that! you should have done the screencast before developing your module than i could have told you earlier 2 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