Jump to content


Photo

new page nav in admin

solved admin page navigation

  • Please log in to reply
5 replies to this topic

#1 robrainfall

robrainfall

    Newbie

  • Members
  • Pip
  • 4 posts
  • 0

Posted 07 May 2012 - 03:02 AM

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?

Attached Thumbnails

  • Screen shot 2012-05-07 at 10.00.42 AM.jpg


#2 diogo

diogo

    Hero Member

  • Moderators
  • 1,973 posts
  • 1059

  • LocationPorto, Portugal

Posted 07 May 2012 - 07:11 AM

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.

#3 Soma

Soma

    Hero Member

  • Moderators
  • 3,183 posts
  • 1733

  • LocationSH, Switzerland

Posted 07 May 2012 - 07:31 AM

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.

@somartist | modules created | support me, flattr my work flattr.com


#4 Soma

Soma

    Hero Member

  • Moderators
  • 3,183 posts
  • 1733

  • LocationSH, Switzerland

Posted 07 May 2012 - 12:34 PM

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).

@somartist | modules created | support me, flattr my work flattr.com


#5 robrainfall

robrainfall

    Newbie

  • Members
  • Pip
  • 4 posts
  • 0

Posted 11 May 2012 - 04:16 AM

Thank you guys!

#6 ryan

ryan

    Hero Member

  • Administrators
  • 5,753 posts
  • 3102

  • LocationAtlanta, GA

Posted 22 May 2012 - 10:44 AM

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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users