robrainfall Posted May 7, 2012 Share Posted May 7, 2012 How could i accomplish this? I would like to have in the admin a second page navigation and I would like to able to move some elements from the default page navigation to the other one. The element and their children. Any ideas on this? Link to comment Share on other sites More sharing options...
diogo Posted May 7, 2012 Share Posted May 7, 2012 Hi, and welcome to the forum! What you are asking is not that simple because this is not the way that ProcessWire is designed to work. It's not impossible though, and if you have the skills to create a module you can do it. I can't help you a lot with this, but maybe someone who can will jump in the discussion. What I can do is help you to get started. Here it goes To make a page appear in the admin navigation, you just have to make sure that it is children of the admin page in the tree. You can do this with any page with any template. If you want this page to behave and look like the other admin pages, you will have to give it the admin template... go ahead an try it... when you do this, the page will simply say "This page has no Process assigned". This means, you will have to create a process module that does what you want and assign it to the page you created. If you edit the page and choose from the several processes that already exists, you can see how it works. The process modules are on the wire/modules/Process folder of your PW install, have a look at some of them to get a feel of how it works. 2 Link to comment Share on other sites More sharing options...
Soma Posted May 7, 2012 Share Posted May 7, 2012 Hey rob. What diogo said. You can create a admin page using the "admin" template. It would be placed under the locked "admin" page tree. The admin template has a field "Process". After creating the page you'll see it under tab "content". Now you have to create a process module to serve functionality for the newly created admin page. Once installed it can be selected from the field "Process". I did a quick example that shows such a module, and even how to use the ProcessPageList module of processwire to create a tree. The id set will be the parent page (your Architects) for example. ProcessPageListCustom.module create the module under /site/modules/ and install it. <?php class ProcessPageListCustom extends Process{ public static function getModuleInfo() { return array( 'title' => 'Custom Page List', 'summary' => 'List pages in a hierarchal tree structure', 'version' => 100, 'permission' => 'page-edit' ); } public function execute(){ $pl = $this->modules->get("ProcessPageList"); $pl->set('id',1001); // or any other parent page return $pl->execute(); } } You can, of course, use any code to generate a list of pages. 9 1 Link to comment Share on other sites More sharing options...
Soma Posted May 7, 2012 Share Posted May 7, 2012 While testing this module with the ProcessPageList rendering a part of the page tree, I recognized a strange behaviour. When I enter the get "open=" (processwire/test/?open=1008) to the url it adds another set of childs (duplicate) but opens the page correctly (the one in the get / which are now doubled too). Link to comment Share on other sites More sharing options...
robrainfall Posted May 11, 2012 Author Share Posted May 11, 2012 Thank you guys! Link to comment Share on other sites More sharing options...
ryan Posted May 22, 2012 Share Posted May 22, 2012 When I enter the get "open=" (processwire/test/?open=1008) to the url it adds another set of childs (duplicate) but opens the page correctly (the one in the get / which are now doubled too). I think this issue here is that 'open' and 'id' aren't meant to be used together. It's meant to be one or the other. When they are both used, you'll get duplication. Maybe there is a use for them to work together, and it could probably be done, but it's not come up as a need yet. Though if someone else has a use for it, I'll be happy to take a closer look to see what might be possible in the future. Link to comment Share on other sites More sharing options...
alkahest Posted July 30, 2013 Share Posted July 30, 2013 Hey rob. What diogo said. You can create a admin page using the "admin" template. It would be placed under the locked "admin" page tree. The admin template has a field "Process". After creating the page you'll see it under tab "content". Now you have to create a process module to serve functionality for the newly created admin page. Once installed it can be selected from the field "Process". I did a quick example that shows such a module, and even how to use the ProcessPageList module of processwire to create a tree. The id set will be the parent page (your Architects) for example. ProcessPageListCustom.module create the module under /site/modules/ and install it. <?php class ProcessPageListCustom extends Process{ public static function getModuleInfo() { return array( 'title' => 'Custom Page List', 'summary' => 'List pages in a hierarchal tree structure', 'version' => 100, 'permission' => 'page-edit' ); } public function execute(){ $pl = $this->modules->get("ProcessPageList"); $pl->set('id',1001); // or any other parent page return $pl->execute(); } } You can, of course, use any code to generate a list of pages. Does this still work? I'm testing it out with several different parent IDs, but the admin page always returns the full, default tree. Edit: Oops it does - one clarification is that whatever you name the class, you have to pick that from the dropdown for the admin page after the module's installed. Link to comment Share on other sites More sharing options...
melissa Posted March 20, 2014 Share Posted March 20, 2014 I'm wondering if there's a way to hook into the execute function to return a page list that is filtered by template or something other than parent. Or maybe say by parent and then filtered again by some other variable? I'd like to have some pages that share a parent but have different templates - which is no problem - but I'd also like to be able to quickly see each page type in a list. Does anyone know if there's a way to accomplish this? Link to comment Share on other sites More sharing options...
adrian Posted March 20, 2014 Share Posted March 20, 2014 Hi Melissa and welcome to the forums! Not exactly what you are asking for, but this might suffice for your needs: http://processwire.com/talk/topic/5835-lister/ 1 Link to comment Share on other sites More sharing options...
melissa Posted March 21, 2014 Share Posted March 21, 2014 So awesome! That's exactly what I need - I'll keep an eye out for when that's available. Link to comment Share on other sites More sharing options...
tekno Posted August 27, 2015 Share Posted August 27, 2015 @Soma with this module the created new page links to list function. how can i link to directly edit page? appreciated Link to comment Share on other sites More sharing options...
tekno Posted August 27, 2015 Share Posted August 27, 2015 aaa. theres another thing. how to add custom fields to the page (admin template). how everyone uses this custom pages? list on parent page on main nav bar and add chield pages with different template? 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