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 Robin S
      Breadcrumb Dropdowns
      Adds dropdown menus of page edit links to the breadcrumbs in Page Edit.

      Installation
      Install the Breadcrumb Dropdowns module. The module requires ProcessWire >= v3.0.83 and AdminThemeUikit.
      There is a checkbox option in the module config that determines if the breadcrumb dropdowns will include pages that the user does not have permission to edit.
      Features/details
      The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages. In the dropdown menus the current page and the current page's parents are highlighted in a crimson colour to make it easier to quickly locate them in case you want to edit the next or previous sibling page. Unpublished and hidden pages are indicated in the dropdowns with similar styling to that used in Page List. If the option to include uneditable pages is selected then those pages are indicated by italics with a reduced text opacity and the "not-allowed" cursor is shown on hover. There is a limit of 25 pages per dropdown for performance reasons and to avoid the dropdown becoming unwieldy. If the current user is allowed to add new pages under the parent page an "Add New" link is shown at the bottom of the breadcrumb dropdown. If the currently edited page has children or the user may add children, a caret at the end of the breadcrumbs reveals a dropdown of up to the first 25 children and/or an "Add New" link. Overriding the listed siblings for a page
      If you want to override the siblings that are listed in the dropdowns you can hook the BreadcrumbDropdowns::getSiblingsmethod and change the returned PageArray. For most use cases this won't be necessary.
      Incompatibilities
      This module replaces the AdminThemeUikit::renderBreadcrumbs method so will potentially be incompatible with other modules that hook the same method.
       
      https://modules.processwire.com/modules/breadcrumb-dropdowns/
      https://github.com/Toutouwai/BreadcrumbDropdowns
    • By Mustafa-Online
      I got a field with a type of "files" named: course_file .. how can I upload it to custom directory??
    • By Thomas Diroll
      Hi guys I'm relatively new to PW and just finished developing a page for a client. I was able to include all necessary functionality using the core fieldtypes but now I it seems that I need to extend them with a custom one. What I need is a simple button, that copies the absolute url (frontend not PW-backend) of the page which is currently edited to the clipboard. As this feature is only needed inside a specific template, I tend to use a custom fieldtype which provides this feature. I've been looking inside the core modules code (eg. FieldtypeCheckbox.module) but I don't really get the structure of it and how its rendered to the admin page. I also didn't find a lot of tutorials covering custom fieldtypes.
      Maybe some of you could give me some tips on how to write a basic custom fieldtype that renders a button which copies the value of
      page->httpUrl() to the clipboard using JS. Thanks!
    • By Jacek
      I'm coding my first module now. I've just managed to add a button to the page edit form but am not content with its placing. Is there any way to place it just next to the input field? I've marked the desired place with the arrow on the attached screenshot.
      My current code:
      $this->addHookAfter('ProcessPageEdit::buildFormContent' , $this, 'addButton');
      public function addButton($event){
      $form = $event->return;
      $f =$this->modules->InputfieldSubmit;
      ...
      $form->insertAfter($f, $form->get("bgg_id"));
      }
      "bgg_id" is the name of the targeted field.
       

    • By Noel Boss
      Admin Theme Boss
      A light and clear theme based on Uikit 3
      Features
      Three unique color options Beautiful typografy using Roboto Condensed Extended breadcrumb with edit links Extends AdminThemeUikit, you can continue using all AdminThemeUikit features Option to activate theme for all users Color Variants:
      ProcessWire Blue

      Vibrant Blue

      Dark Black

      Requirements
      Requires AdminThemeUikit installed and activated.
      Installation
      Make sure the above requirements are met Go to “Modules > Site > Add New“ Paste the Module Class Name “AdminThemeBoss“ into the field “Add Module From Directory“ Click “Download And Install“ On the overview, click “Download And Install“ again On the following screen, click “Install Now“

      Install manually
      Make sure the above requirements are met Download the theme files from GitHub or the ProcessWire Modules Repository. Copy all of the files for this module into /site/modules/AdminThemeBoss/ Go to “Modules > Refresh” in your admin Click “Install“ on the “AdminThemeBoss“ Module