Anyway to remove the Front Page and Dashboard sub-links?

Asked by tad

I've noticed that the Front Page and Dashboard links are always there, I'm wondering if there is any way I can remove those?

Question information

English Edit question
PHPDevShell Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Greg (gregfr) said :

There are several answers, based on how your site is structured.

If you have your own "theme", just don't include the menu.

If you use a theme from the distro, you can easily override a module method to filter out what you don't want.

You can also use an even simpler CSS based-solution: the "home" button as a "home" css class, so you can just add this to your css:

.home { display: none; }

Feel free to provide more info so I can give you the best advice.


Revision history for this message
tad (bittiez) said :

The display none works flawlessly! Thank you, now that peaks my interest though, is there any fairly easy way to put menu items there from within a plugin?
Something like
$this->navigation->addMenuItem() or anything similar to that?

Revision history for this message
Greg (gregfr) said :

Do you want to ouput the whole menu bar at some point, or do you want to add a new menu inside the menu bar?

Revision history for this message
tad (bittiez) said :

Essentially all I want to do is add a sub menu item(same level as the Front Page link and Dashboard link) from within a plugin dynamically not from the config file if that's possible, if not it's not a problem.

Revision history for this message
Best Greg (gregfr) said :

LOL it is possible :)

Let me explain how you can find out about it.

First, what you want is to alter the theme, so open the file "/themes/cloud/theme.php" (provided you're using the default "cloud" theme). You'll have the whole page at a glance. In your browser, right-click the "front page" button and select "inspect element". You'll notice the element is a LI inside an UL of ID "bread", itself inside a DIV of ID "history". Compare to the theme php file and you'll find that code:

   <div id="history">
    <ul id="bread">
     <?php $template->outputBreadcrumbs() ?>

So you know what you have to change is the method "outputBreadcrumbs()" of the PHPDS_template class. Open the file "PHPDS_template.class.php" and look for the method:

 public function outputBreadcrumbs ()
  // Check if output should be modified.
  if ($this->modifyOutputBreadcrumbs == false) {
   print $this->navigation->createBreadcrumbs();
  } else {
   print $this->modifyOutputBreadcrumbs;

Well the solution is now at hand: you just fill the field "modifyOutputBreadcrumbs" with what you want, for example:

$default_bread = $this->navigation->createBreadcrumbs();
$my_bread = 'This goes <b>before</b> - '.$default_bread.' - this goes <b>after</b>';
$this->template->modifyOutputBreadcrumbs = $my_bread;

Of course this is a quick and dirty hack, because if another plugin does the same, only the last change will be seen. However it can show how you can easily change something by investiguating it.

Revision history for this message
tad (bittiez) said :

Thanks Greg, that solved my question.

Revision history for this message
Greg (gregfr) said :

You're welcome. Feel free to ask if you have any question.

You'll discover that PHPDevShell offer you many ways of altering the default behavior, depending on how/how much you want to change (and also how clean or fast you want it)