By carlmcdade on
I have been trying to get breadcrumbs to appear in all main module pages. I am confused as to what criteria determines if it should appear or not.
0 = none with no code on search
1 = appears
Home = 0
archives = 0
blogs = 0
books = 0
files = 1
polls = 0
search = 0
forum = 1
Can someone explain why this is this way and how I can get it to work in the modules?
Comments
Some of the logic I don't get
This code is in the blog module for the breadcrumb navigation. I don't get the logic behind this type of coding.
Well anyway changing it and removing the if clause will get the breadcrumb to appear which is what I want. Or I could change to reflect that the trail is at a parent node. If I knew what $page was supposed to do that is ;) I changed it to:
And got a parent link but only if I clck on the "myblog" link. Weird. Just removing the clause give the parent and child.
---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.heroforhire.net
Arrgh! so now what
@param $page
00272 * Whether the node is being displayed as a standalone page. If this is
00273 * TRUE, the node title should not be displayed, as it will be printed
00274 * automatically by the theme system. Also, the module may choose to alter
00275 * the default breadcrumb trail in this case.
So the trail should be appearing with the $page= FALSE and not when $page=TRUE
But it's not appearing either way. So is this a bug or am I just crazy?
---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.heroforhire.net
hook_menu or $breadcrumb
Now I am really confused. After two days of reading the only thing I could find is hook_menu, the proper way to make links but nothing on breadcrumbs. Nothing in the docs on how to use hook-menu to create a breadcrumb either. The docs make reference to example_page.module. The only one I could find was in the CVS but this had no hook_menu example in it. hook_link was there with nothing useful but I have yet to find a complete example of hook_menu or breadcrumb.
---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.heroforhire.net
I don't really understand.
I'm not sure I grasp the problem you're seeing. Are you getting no breadcrumb at all on some pages? Or not the breadcrumb you expect?
Breadcrumb trails are usually created automatically by the menu system in Drupal 4.5. This way, your location in the menu tree will always correspond to your location as indicated by the breadcrumb trail. However, sometimes a module needs to override this behavior. In the case of blog posts, the blog module uses menu_set_location() to change the current location to home -> blogs -> author's blog -> blog post. This should set the breadcrumb appropriately, as well as expanding the proper menu items if, say, you have enabled the "blogs" menu item in the menu admin. If you're not seeing this, you may have found a bug or a strange interaction with a contributed module.
You were probably looking at the 4.4 branch of the docs directory if you found a hook_link() implementation. The 4.5 and HEAD branches will use hook_menu().
The real problem is menu admin
The real problem is that menu admin is not working. There is a bug in it that causes 4.5 to stop dead if you try and use the admin menu module. So I don't know how much access I have to different menus without it. I have gotten blogs to work but using the same code does not work in all the modules because people have used different implementation and function names or have done things so differently that just place a copy of the code in the view section of the mod does not work. So I am down to doing this completely manually without any documentation.
I want the breadcrumb to appear on those modules that I have marked in the first post.
---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.heroforhire.net
Admin menu module breaking
This was a known bug which was fixed in 4.5 before the release. It was in fact caused by the user improperly prefixing the sequence in database.??sql. Because we expected others to have a similar problem, we explicitly caught this issue in the code.
Manually having to prefix the DB definition is indeed bad, but Adrian said he would work on the install system for 4.6, which would put an end to that.
Yes!
I took a tip from someone here and did an install with a new database, no table prefixes and with error levels reduced. Now the site is up and running with no discernable errors or bugs. So the basic site is done now i only have to be careful of contributed modules and themes.
Thanks!
---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.heroforhire.net