Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The API module makes some nice breadcrumbs on its pages. api.drupal.org should display them.
I'm assuming the theme is turning the breadcrumbs off; if not, I guess this belongs in a different project. But anyway, it would be very nice to have them turned on.
I'm not sure if there's a need for CSS changes.
Comment | File | Size | Author |
---|---|---|---|
#11 | breadcrumbs-api-1526504-11.patch | 934 bytes | mgifford |
#9 | breadcrumbs-api-1526504-9.patch | 934 bytes | mgifford |
#7 | breadcrumbs-api-1526504.png | 140.84 KB | mgifford |
#7 | breadcrumbs-api-1526504.patch | 580 bytes | mgifford |
Comments
Comment #1
drummdrupalorg_crosssite does this.
Comment #2
drummComment #3
jhodgdonAt this point, this is a version 7 fix, and I think we need the breadcrumbs for sure if we're planning to get all of contrib on api.d.o (and we just need them anyway).
Comment #4
jhodgdonHere's the code that is turning off the breadcrumbs, in drupalorg_crosssite_preprocess_page():
So I guess this would instead need to check the 'drupalorg_site' variable to see if it is on the API site, and if so, not turn off breadcrumbs after all.
Comment #5
mgifford@drumm - is there a spun up version of the api site /var/www/dev
Would be good to test this. Seems like an easy fix that would provide usability advantages.
Comment #6
jhodgdonThere is an API site clone currently at
http://docs-api.redesign.devdrupal.org/api/drupal
that was set up for another purpose, but could be used. The API section of the site has not been tampered with.
Comment #7
mgiffordYes, that would be useful...
http://docs-api.redesign.devdrupal.org/api/drupal/includes!menu.inc/func...
It's useful to have context.
Comment #8
jhodgdonThe patch looks OK although the code comment should perhaps be updated, and it seems like we don't need two calls to variable_get('drupalorg_site', 'main') [there is one just above this code]. Should we refactor slightly?
But I am in 100% agreement that we need to turn the breadcrumbs on, and this does work [not surprising since I filed the issue. :) ].
Comment #9
mgiffordTrue enough.. How's this?
Comment #10
jhodgdonWorks for me! Except the word "excpet" is misspelled in the comment. :)
Comment #11
mgiffordArg.. Typos.. :)
Comment #12
jhodgdonThanks! I think we should commit the patch in #11 and push it out to api.drupal.org.
I have confirmed that it is working fine on the dev site. Example pages with breadcrumbs:
http://docs-api.redesign.devdrupal.org/api/drupal/includes!bootstrap.inc...
http://docs-api.redesign.devdrupal.org/api/drupal/core!lib!Drupal!Core!D...
I think the breadcrumbs are useful and we should have them enabled.
The only other possible thing to do would be to test it on a d.o clone and verify it doesn't turn on breadcrumbs or cause any other trouble. The patch looks completely safe in that regard though -- it was done carefully -- and I do not know which d.o clone to test on -- wouldn't want to screw someone's site up with some unknown code coming in.
Comment #13
jhodgdonI just tested this patch on one of the d.o dev sites. I verified that all the behavior that the $main_site variable is using is still working with this patch installed.
So we should be OK.
Comment #14
drumm"Home" and "API reference" both go to the same place as the "Homepage" link. Pages that have breadcrumbs should not be redundant with other navigation in the header.
Comment #15
mgiffordSo is that a problem with the API module?
Comment #16
drummNo, the two links being the same is the result of the home page being ''api/drupal". Maybe core's breadcrumbs should be smarter about not generating duplicate links. We don't really need to worry about that for this issue, since we don't want either.
drupalorg_crosssite already has a function for abbreviating breadcrumbs,
drupalorg_crosssite_child_of()
. That needs to be used correctly for this issue, instead of trying to take a shortcut.I'll see about fixing this myself on the docs-api dev site.
Comment #17
drummCommitted & deploying http://drupalcode.org/project/drupalorg_crosssite.git/commit/4bbf06d.
Comment #18
mgiffordThanks! https://api.drupal.org/api/drupal/includes!actions.inc/function/actions_...
Comment #19
jhodgdonYEAH!!! Thanks!
This will become more and more essential as we add more projects to api.d.o (if we ever do go that route).
Comment #20
mgiffordWhat do folks think about adding a bit of padding around the breadcrumb?
Say:
Comment #21
jhodgdonNot a bad idea. Would need to go into bluecheese.
Comment #22
drummThat should be a separate issue. Please consider how that would affect other pages with breadcrumbs too.
Comment #23
mgiffordAdded #2182993: Provide more space between breadcrumbs and page content on api.drupal.org