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 2
Link to comment
Share on other sites

In ProcessWire as always you have the freedom to choose from a variety of options. What fits best for you and the editors depends on a lot of factors, but I'd say your options are (from easy, but with default style and options to hard with full freedom):

  • Stick with PW page tree, organise your pages well and properly define access of your users so they see only what they need to see. That's probably the easiest solution, but you get the default PW backend which has pros and cons.
  • Use a module to adjust the backend to your needs. Possible modules are AdminRestrictBranch or the dashboard module. Or any other module that helps you to customise the backend.
  • Create custom admin pages. This is still very easy and you stay in the "safe" PW backend, which means you don't have to take care of everything on your own and you can build on top of proven and battle-tested concepts and code.
  • Create a custom backend. The ProcessWire backend is on its own just built around the PW api, so you can build something similar on your own. This is by far the option with most freedom but also the hardest option, as you have to take care of almost anything (access control, rendering, navigation, etc...)

Somewhere in-between those options might be to enhance your frontend with some shortcuts, like buttons to "add new blogpost" or to "manage items" or whatever. These buttons could directly link to backend pages, so it might be easier for clients to find what they need, because what many often forget is that even though the PW backend is super clean and easy to use, there is a barrier or gap between "frontend" and "backend" that for clients is sometimes harder to grasp than one might think!

RockFrontend, for example, comes with ALFRED, which adds hover info with an edit icon:

dBSpYJq.png

And when clicked it opens the dedicated page from the backend directly in a modal in the frontend:

t2MsxVw.png

There are other modules with similar solutions as well. You have the freedom to choose 😉 

  • Like 2
Link to comment
Share on other sites

On 10/4/2024 at 5:06 PM, Robin S said:

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.

I agree with you on it being simple, but when you are managing 1800 books, those books stored at 15 different locations, and over 100 library users, the page tree isn't really very practical. Though the search in processwire helps, I guess I'm looking for something a little easier for the tasks the 'librarians' have to do on the back end. 

On 10/5/2024 at 6:07 AM, bernhard said:

Create custom admin pages. This is still very easy and you stay in the "safe" PW backend, which means you don't have to take care of everything on your own and you can build on top of proven and battle-tested concepts and code.

I'm wondering if the suggestion to use CustomAdminPages would be the way to go. I suppose I could make a page so when a librarian logs in, they would just see their books in a nice table (using datatables with filtering/sorting?) with clear buttons for their various tasks. Can these be set as the default page the admin opens to if the users isn't an administrator? And when they complete a task (check in a book for example), have it go back to this page? Almost like a dashboard for each librarian I suppose.

Link to comment
Share on other sites

This sounds like a perfect use case for RockGrid, if your clients have 65€ left (docs are under construction but if you need help I'm around).

But again you have several options. You could also use regular page listers. Or you can use Lister Pro.

When using RockGrid you get any table shown at https://tabulator.info/

Or you could create a custom admin page and build a custom tabulator yourself. It's not that hard if you know JS and HTML. RockGrid comes with a lot of extras, like SSE for bulk operations, action buttons (including ajax operations) etc., but if you just need a table then it's quite easy to just add a tabulator table to the backend.

Oh, and we have the relatively new PageListCustomChildren

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