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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drumm’s picture

Project: Bluecheese » Drupal.org customizations
Version: » 6.x-3.x-dev

drupalorg_crosssite does this.

drumm’s picture

Project: Drupal.org customizations » Drupal.org cross-site customizations
jhodgdon’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Issue tags: +api.drupal.org contrib

At 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).

jhodgdon’s picture

Here's the code that is turning off the breadcrumbs, in drupalorg_crosssite_preprocess_page():

  $main_site = (variable_get('drupalorg_site', 'main') === 'main');

  // In most cases, the navigation elements should provide orientation within
  // the site. Breadcrumbs are usually not necessary.
  if (arg(0) !== 'admin') {
    $vars['breadcrumb'] = '';
  }

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.

mgifford’s picture

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

jhodgdon’s picture

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

mgifford’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
580 bytes
140.84 KB

Yes, that would be useful...
http://docs-api.redesign.devdrupal.org/api/drupal/includes!menu.inc/func...

It's useful to have context.

jhodgdon’s picture

The 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. :) ].

mgifford’s picture

Issue summary: View changes
FileSize
934 bytes

True enough.. How's this?

jhodgdon’s picture

Works for me! Except the word "excpet" is misspelled in the comment. :)

mgifford’s picture

Arg.. Typos.. :)

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! 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.

jhodgdon’s picture

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

drumm’s picture

Status: Reviewed & tested by the community » Needs work

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

mgifford’s picture

So is that a problem with the API module?

drumm’s picture

Assigned: Unassigned » drumm

No, 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.

drumm’s picture

Status: Needs work » Fixed
mgifford’s picture

jhodgdon’s picture

YEAH!!! Thanks!

This will become more and more essential as we add more projects to api.d.o (if we ever do go that route).

mgifford’s picture

What do folks think about adding a bit of padding around the breadcrumb?

Say:

.breadcrumb {
    padding-bottom: 15px;
}
jhodgdon’s picture

Not a bad idea. Would need to go into bluecheese.

drumm’s picture

That should be a separate issue. Please consider how that would affect other pages with breadcrumbs too.

mgifford’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.