Jump to content

How To Remove Breadcrumbs & modify Headline ?


Mustafa-Online
 Share

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