Jump to content
renobird

Hide page tree in the admin

Recommended Posts

I am looking for a way to add a full pagetree to select the path to redirect users to. It would enable us to redirect to FE pages too , and possibly to the profile page....

Does anybody know how to replace the standard selector whith a full pagetree to select a page in that  module ?

 

Share this post


Link to post
Share on other sites

Hi all,

As I want to make full use of all the features build standard in the Admin, I'm currently creating a custom dashboard for user so they can add and edit pages. These user may only acces their own created pages and of course add new once using 1 restricted template. For this I use Admin Restrict Page Tree module. 

This is working as expected, page tree and page tab is not visible. But I found a bug which I cant seem to solve:

As said the user has the ability to add a page. On this add page, the breadcrumbs are shown. If a user would click, it will open the page tree on /admin/page/list/. This should also be not visible, but it still is. I cant seem to restrict this page.

Same goes also for the admin/page/add/ (showing all the parent page, while the user should only be to see the one page I offer him to edit.) - this one is more difficult and I could except if this was not possible. 

Any pointers would help!

Share this post


Link to post
Share on other sites

To hide breadcrumb, I used this hook in ready.php

$this->addHookBefore('Process::breadcrumb', function(HookEvent $event) {
	$Process = $event->object;
	$Process->wire('breadcrumbs')->removeAll();
});

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
20 hours ago, monchu said:

To hide breadcrumb, I used this hook in ready.php


$this->addHookBefore('Process::breadcrumb', function(HookEvent $event) {
	$Process = $event->object;
	$Process->wire('breadcrumbs')->removeAll();
});

 

Thanks! So this works for all pages except: /your-admin/page/add/ . Somehow this page is using a different "breadcrumb". Any ideas? @monchu @adrian

Share this post


Link to post
Share on other sites

Hey @DL7, just a quick heads-up: I've merged your questions into the support thread for the Admin Restrict Page Tree. The modules/plugins area of the forum is intended for module-specific support threads (one per module), and you can find the correct thread via the modules directory.

Share this post


Link to post
Share on other sites

@teppo  Thanks! I only cant find that thread. Via the module page, this board is linked. Could you let me know where to find the correct board?

I did some investigation and found out that the AdminUIkit uses a different way (or at least code) to populate the breadcrumb. For that reason the standard way to remove them doesn't work. To be able to manipulate the output, I used a hook. 

 

$this->addHookAfter('AdminThemeUikit::renderBreadcrumbs', function(HookEvent $event) {
  // Get the object the event occurred on, if needed
  $AdminThemeUikit = $event->object;
  // Populate back return value, if you have modified it
  $event->return = $return;
});

 

Share this post


Link to post
Share on other sites
4 hours ago, DL7 said:

@teppo  Thanks! I only cant find that thread. Via the module page, this board is linked. Could you let me know where to find the correct board?

I merged your question to the correct thread earlier, so yes – this is it 🙂

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...