Mustafa-Online

How To Remove Breadcrumbs & modify Headline ?

Recommended Posts

To remove the breadcrumbs, and change headline and browser title:

$this->addHookBefore('Process::execute', function (HookEvent $e) {
    /** @var Process $process */
    $process = $e-object;
    if ($process != "ProcessModule") return;
    $e->wire('breadcrumbs')->removeAll();
    $e->wire('processHeadline', 'asd');
    $e->wire('processBrowserTitle', 'asd');
});

You can't really remove headline and browser title, because admin theme defaults to page name if it doesn't exist.

// AdminThemeDefaultHelpers.php

/**
 * Get the headline for the current admin page
 *
 * @return string
 *
 */
public function getHeadline() {
    $headline = $this->wire('processHeadline'); 
    if(!$headline) $headline = $this->wire('page')->get('title|name'); 
    // ...
}


/**
 * Render the browser <title>
 *
 * @return string
 *
 */
public function renderBrowserTitle() {
    $browserTitle = $this->wire('processBrowserTitle'); 
    if(!$browserTitle) $browserTitle = $this->_(strip_tags($this->wire('page')->get('title|name'))) . ' • ProcessWire';
    // ...
}

But you can set it to a unicode space character, like &nbsp; which works well enough.

$e->wire('processHeadline', "&nbsp;");
$e->wire('processBrowserTitle', "&nbsp;");

 

  • Like 4

Share this post


Link to post
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


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Pixrael
      Hi guys!
      What do you think about something like this? Because I use this option regularly in the Windows File Explorer breadcrumb and it's very useful. The drop-down menu can display only published/visible child pages. I've tried to find how to do it as a module, but I'm not a coder with enough skills for that ... or I don't know if I can use hooks to do that ...

    • By maxf5
      Hey guys,
      i have some sort of events/campaigns which have a lifespan. To deactivate them i made a checkbox-field called closed and i have to deactivate them manually.
      I would like to put two fields in the template, startdate and enddate, which activate/deactivate that checkbox field automatically.
      Dou you have any idea how to bring that on the run?
    • By AAD Web Team
      Hi,
      I've put in a support request (as a followup on an existing one) for this but it's nearly 10pm Ryan's time, so I thought I'd ask on here just in case someone can help...
      Yesterday we purchased ProDrafts, but I couldn't get the key to validate. Every time I hit submit on the module settings screen the key would be removed from the field I entered it in, and then it would complain about the missing value. I put in a support request and Ryan responded last night. It turned out it was because we're behind a proxy/firewall. He gave me a fix to get around that issue - some code to go into admin.php. I put that code in and saved admin.php, but now I can't even get into our admin anymore!
      (Just to clarify, I took the code back out and saved admin.php but that made no difference. It's definitely not the new code causing the error.)
      The errors relate to a lack of permission on the ProDrafts module (see attached screenshot). We do have a key, but evidently the code Ryan gave me to add the key in via admin.php isn't taking effect before the error is thrown...?
      I tried removing the ProDrafts directory from the modules directory, but that hasn't helped.
      Is there a hook I can put in somewhere to tell it not to load ProDrafts at all, or not check the permissions? Or is there some way to manually uninstall it from the file system?
      Thanks!
      Margaret

    • By SwimToWin
      In my world, Super Users / Editors should only be able to work with Pages and administer users.
      Everything else is the domain of the web master. The purpose is to prevent technically inexperienced editors from destroying core elements of a site, such as fields and templates.
      That leaves me with the question, how to deny Super Users access to Setup, Modules and Roles / Permissions?
      PS: May I also suggest that it shall be possible to set Permission for each of the main menu items - including their sub-menu items.

    • By SwimToWin
      How can I translate the admin buttons that are shown when mousing over a page in the admin interface ("Edit", "View", "New", "Move", "Unpub", "Hide", "Lock", "Trash")?

      The site uses the built-in Language Support module. I am here: /processwire/page/.
      I looked for files to translate in the Languages setup section (/processwire/setup/languages/edit/?id=1234), so far unsuccessfully because I was not able to identify a file to translate.