Ah, breadcrumbs, how I hate you. Such a tiny little piece of a site, yet so much complexity and time spent. For some clients, you would think this is their number one must have feature based on how much time they spend checking and critiquing them page-by-page.Existing solutions
In typical Drupal fashion, "there's a module for that!" Or more truthfully, "there are 17 modules for that!" Let's run down a few.
Please note that I am NOT hating on these modules because they're bad. Most of them are actually quite good for the tough problem they're trying to solve.Custom Breadcrumbs
Custom Breadcrumbs is perhaps one of the earliest modules for this, dating all the way back to 2006. It has a bunch of submodules and a fancy interface that looks like this:
And that's just nodes. There are also interfaces for Views, Panels, Taxonomy, and Paths. Now, I'm not saying this interface is bad--it's not. But I bet you couldn't understand it at first glance. That's because breadcrumbs are just a hard thing to configure visually. (I'm going to say that again so be ready).
How much code does Custom Breadcrumbs ship with?
That's 6258 lines, counting a few text files and comments and blank lines. For Breadcrumbs. Debugging when things don't work as they should is obviously no picnic.Crumbs
Crumbs is less than 4 years old so it's just a toddler compared to Custom Breadcrumbs. Let's take a look at a few of its admin pages.
Here's how you specify a breadcrumb pattern for content:
And here's a snippet of how you choose which plugins take priority over other plugins:
Again, these aren't bad interfaces by any means. They're just symptoms of the problem, which is that breadcrumbs are just a hard thing to configure visually.
How about code?
Crumbs currently ships with 9135 lines of code, again including text files and comments and blank lines.Hansel
Hansel is about as old as Crumbs and touts the slogan "Breadcrumbs done right!" It contains 7 modules (one each for Domain, OG, Taxonomy, Forum, Exporting, the UI, and core functionality) and weighs in at a lightweight 4421 lines currently.
Here's what it looks like:
Would you know what to enter where on that screen? Would you know how to build out breadcrumbs for nodes tagged with a taxonomy using that? Yet again, this isn't a problem with the module, the module is fine. Breadcrumbs are just a hard thing to configure visually.Others
This list is by no means complete. Here are a few others that exist and are, in my perhaps grumpy opinion, either lacking in functionality or equally as bulky and confusing.
- Path Breadcrumbs (here's a screenshot)
- Breadcrumbs By Path (only works for items that follow a predictable nested URL aliasing convention)
- Menu Breadcrumb (only works for items in menus)
- Others? If you know of another breadcrumb module that you absolutely love, feel free to tell me all about it in the comments.
Easy! Breadcrumbs are just a hard thing to configure visually!
They can depend on so many things and they need to satisfy so many different use cases, that it's just really hard to support all of that and do it in a way that isn't a GUI onslaught.
Let's take a specific example. Say we have just one single content type (just one!) called "Story". And let's pretend that there's a "Category" taxonomy attached to it. Here are some very common and completely valid ways one might want to set up those breadcrumbs:
- Make all news authored by a specific user named John Writer follow the "Editorials > John Doe > Title Of Post" pattern.
- Make all news under the "Press Release" taxonomy term (in the Categories vocabulary) follow the "Press Releases > Title Of Post" pattern
- Make all news posted before the current calendar year follow the "News Archive > Year > Month > Title Of Post" pattern
- Make all news posted in the "Blog" taxonomy term follow the "Blog > Author's Name > Year > Month > Title Of Post" pattern
So that's four completely different use cases all on the same content type with only one taxonomy attached to it. That doesn't even touch on multiple content types, multiple taxonomies, different entities (user profiles, and Drupal Commerce products are quite common) or even non-entity pages (Views pages, Panels pages, etc.).
Do you see what I mean? It's a losing game.
Blame "Invented Here" syndrome or Drupal's love of all things GUI, or both. Either way, most people are trying to make the best of a bad thing by working around the various failings of these contrib modules.An alternative approach
You are a programmer. Do it in code. It's easy! Just use our friend drupal_set_breadcrumb() like so:
Here's a rundown of how you could satisfy the 4 use cases above in code, in a few minutes.
- Use hook_node_view($node), grab the author out of $node->uid, and if it's John Writer, set that custom beadcrumb using drupal_set_breadcrumb().
- Use hook_node_view($node), grab the category out of $node->field_news_categories (or whatever the field is called), and run taxonomy_term_load() to grab the whole term, and if the $term->name is "Press Release", then set that breadcrumb.
- Use hook_node_view($node), and if date('Y', $node->created) < date('Y') then set the breadcrumb by passing date('Y', $node->created) and date('F', $node->created) into drupal_set_breadcrumb() for the year and month.
- Same basic idea as #2 above.
Or maybe you're adding breadcrumbs for a Views page? Throw it in a Views hook like hook_views_pre_render(&$view). Oh, you're trying to add breadcrumbs to a taxonomy term page? Throw a drupal_set_breadcrumb() into hook_taxonomy_term_view($term) and call it a day.
See what I mean? This is basic stuff for any Drupal developer, and it saves you many thousands of lines of code and potentially a lot of time debugging that code and trying to understand the interfaces.Caveats
This method won't work when you're dealing with either of the following scenarios:
- You need to accommodate new breadcrumb patterns as things are changed without being able to make code changes. For example, a new promotion is being run tomorrow, with no notice, and that's not enough time to push a code change through QA and find a decent launch window by then. Or maybe you're just an editor who doesn't have code access at all.
- You need to accommodate clients who want to add and configure their own breadcrumbs without relying on you to code it. There's still the difficulty in getting them a module with a UX they can wrap their non-technical brains around, but it's more doable than teaching them to code.
However, if you're not in one of those two situations, then I highly recommend you rid yourself of whatever breadcrumb GUI you've been using.
Or convince the client to get rid of breadcrumbs altogether!Read this next: Drupal and “Invented Here”
22nd Winter Olympics 2014 in Sochi mobilized sports websites around the globe.
If you're going to use popular software like Drupal, one of the downsides is that you'll need to deal with spam.
A lot of OSTraining members report that they many spam user registrations on their site.
In this blog post, we'll look at 10 of the best ways to avoid getting overwhelmed by spam users.
As you know, DrupalCon is just a few short months away and this year we're proud to be hosting it in sunny Austin, Texas. It's session proposal time and this year we are helping to organize the Business & Strategy track. I'm writing to ask you all to submit your session proposals so that we can make this year's DrupalCon the best one yet.Now a bit about the Business & Strategy Track...
This track is for those looking to improve the way that they sell, conceptualize, plan, estimate, manage, or deliver Drupal services and products. Experienced business professionals will share their knowledge and experience on topics such as project management, client communication, team building, culture, and organizational leadership. Sessions in this track will be non-technical in nature.Main themes include:
- Project management, planning, and strategy
- Team management, growth, and business best practices
- Customer service, communication, and marketing
Technology executives, business owners, project and product managers, and others responsible for leading projects or guiding technology decisions and processes within their company or organization. Anyone who wants to improve their company or organization’s ability to deliver Drupal solutions.
The call for sessions is open until March 7, 2014 at 11:59pm CT.Category: DrupalDrupal Planet
This year Google celebrates the 10th birthday of their global program „Google Summer of Code“. The open source program offers student developers over the age of 18 the possibility for a scholarship. Mentoring organizations' application deadline is February 14th.
Google Summer of Code (GSoC) is very popular amongst projects of the open source scene, because students can take on tasks that otherwise wouldn't get done. Participants earn scholarship funds of 5.500 USD, of which 500 USD go to the specific project and their mentors. This concept has a very high success rate and the participator list shows almost all popular open source projects.
We at undpaul love Drupal and the open source idea, which is why we decided to provide mentors to support the development of the Drupal modules FluxPocket, Leaflet and Paragraphs. You can view our proposals in the Task Organization Wiki at groups.drupal.org.
Also make sure to check out these links if you're interested in mentoring or applying for a scholarship.
450 people, in
39 locations, on
worked on Drupal contrib and core (on core alone: 2468 comments on 646 Drupal 8 issues)
during the Global Sprint Weekend.
The User Experience Design (UXD) track is the place to learn about all things UX, content strategy, and visual design for Drupal.
We are inviting community members to submit sessions related to the following topics:
Before the web was used to provide users data access and to automate customer service, there were IVRs. You know these ubiquitous technologies by experience if not by name. You use them to pay bills by phone, check account balances or even register for classes.
If you're trying to make your Drupal site as fast as possible, you might consider using a static HTML file for page not found (404) errors. There are various other solutions that can help make Drupal faster in these situations while still letting you take advantage of Drupal-level redirects and whatnot, but a static page is always the fastest.Read more
Here at Redfin we've come up with a couple of helpful Drush commands that help us with our everyday workflows. The first shows a database string as a URI for Drush aliases, and the second reverts all views that are in an overridden state without any prompting or confirmation.Twitter Facebook
Using Drupal as a platform for fundraising and advocacy usually means having to integrate with several third-party systems. Beyond the expense, this creates situations that make it hard to get a complete picture of your constituency. To solve this problem we are thrilled to announce we have released AbleOrganizer, a community engagement platform and are excited to show you how it works.
Right now, there are nine, highly motivated people on the East Coast of Florida who are burning the midnight oil... focusing evenings on classes and labs, and days on projects and resources to master the Drupal skills that build new careers and make them valuable members of the Drupal Community. They are the select few of the 2014 Drupal Career Starter Program, and in less than two months, most will be ready for work experience as interns.-->
Last week we deployed a major improvement for issue page workflow: https://drupal.org/node/2159813. The issue edit form is back on the issue page, instead of the standard comment form. Huge thanks to webchick, Mark Carver, sanchiz, Bojhan, joachim and everyone else who worked on the issue.
As we mentioned in a previous blog post, we are happy to be offering lead retrieval capability to our DrupalCon exhibitors, who have been asking for it for some time. We know that lead retrieval has been used before at DrupalCon and it raised some concerns among attendees.Personal blog tags: DrupalCon Austin
With DrupalCon Austin fast approaching, the call for submissions is already open! With the impending release of Drupal 8, Austin will be an important event to help us push the DevOps mindset into the forefront with Drupal 8.
Have you been automating the deployment or maintaining Drupal across a large number of systems, testing your code for performance and functional regressions, or architecting Drupal as a service layer? Consider submitting a session!
The DevOps track is interested and seeking topics relating to:
- Automated development / deployment of environments
- Emerging best practices for Drupal 8 continuous integration
- Changes in deployment and testing best practices from Drupal 7 to Drupal 8
- Emerging best practices for Drupal 8 hosting and performance
- Frontend automated regression/performance testing
- Distributed Drupal development (Docker, Vagrant, etc)
- Architectures with Drupal as a service
- Performance best practices
- Configuration management
- Testing best practices throughout the development workflow
See you in June!
Photo credit: alex de carvalho on Flickr
The Charlotte Drupal Drive-in is coming up on February 22nd. I just wanted to take a moment and highlight ours sponsors and the value they are bringing to making this event happen.
Classic Graphics is providing us with a fantastic facility with a large training room and four smaller conferences rooms. Each with projectors. Classic is also providing print marketing materials and access to their talented creative department for the event.
Drupal Association is providing a community cultivation grant which is funding all catering needs for this event so our attendees never have to leave the facility for food.
Command Partners is providing a $100 Apple iTunes card to giveaway and marketing skills to help promote the event.
Thanks to these sponsors for their generosity. Without them, the event just wouldn't happen. There is still time to register for the event. Head over to http://charlottedrupaldrive.in and register today!Blog Category:
It has been awhile since I have published a top modules list for Drupal so I thought with Drupal 8 coming out soon it was time for one last top Drupal 7 modules list. As I have stated in past blogs on this subject, it can be very challenging to sort through the literally thousands of modules available for Drupal. Therefore, what I like to do as an 8 year veteran of Drupal is routinely publish a list of modules that I use most often on projects. In doing so I hope to give newbie developers a good list to start with. Some intermediate developers might also find a handful of less obvious modules that can help them out on their next project as well.
Modules Unraveled: 095 What's New and Updated in Panopoly 1.1 with Tom Kirkpatrick - Modules Unraveled Podcast
- First off, what is Panopoly?
- What was the reason for creating it?
- What are some of the features built in?
- What’s new in 1.1?
- Other distributions are built on top of Panopoly. What are some of the big ones you can think of?
- Do you know of any sites that are already built on top of Panopoly?
- Damien McKenna
Will 1.2 change over to CKEditor? #mup095
- Chris Ball
You mentioned open academy one of your other distributions. what is the state of open academy?
This week's podcast is parts of a fun conversation I had with Ruben Teijeiro at Drupal Camp Vienna in December 2013. I "borrowed" him from mentoring Manuela Hutter at the code sprint to talk with me, but in the end, they both still managed to get a lot done that weekend. Thanks for your contributions, folks!