Jump to content

Back end for users


msavard
 Share

Recommended Posts

Maybe a simple question here, but what is the common practice for allowing users to interact with the back end? Do you just let them into the administrator interface with some access control set? Do you build special pages that they can use to manage content?

I have a library site I built for a local group where I live. I would like to allow the 'librarians' to see what books are checked out, check books back in, send canned emails out to people who have overdue books, add new books, etc. But seeing all the back end of Processwire will be way too intimidating to them. 

In this case, would it be worth creating pages that allow the librarian to interact with the data, but shield them from the admin sections of Processwire? Or is that too much of a chore and should I just show them how to use the backend and tell them to get used to it? 

Link to comment
Share on other sites

2 hours ago, msavard said:

But seeing all the back end of Processwire will be way too intimidating to them.

Not sure what you mean here. The ProcessWire admin for non-superusers is the most minimal CMS back-end I've seen. It's just the page tree, which is easily understood even by beginners because it corresponds to the front-end structure. And from the page tree editors can only edit the pages that have the templates you allow for them.

If the page tree is still too overwhelming you customise it with hooks. If the editors only need to deal with pages in a particular branch of the tree you can conditionally set the top-level parent of the tree.

$wire->addHookBefore('ProcessPageList::execute', function(HookEvent $event) {
	/** @var ProcessPageList $ppl */
	$ppl = $event->object;
	if($event->wire()->page->process !== 'ProcessPageList') return;
	if($event->wire()->config->ajax) return;
	// If the user has the "editor" role...
	if($event->wire()->user->hasRole('editor')) {
		// Limit Page List to only show a particular page and its descendants
		$ppl->id = 1085;
	}
});

image.png.2f6723ce94f8bb523bf22b1d3b99ab5d.png

Or for more complex situations you can control which pages are "listable" individually:

 

  • Like 1
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...