Reference Dialog Helps Make Content Management A Breeze!

William O'Beirne
#Drupal | Posted

The References module is an incredibly useful module for linking pieces of content together, with little effort. But when your site begins reaching node counts in the thousands, it quickly becomes difficult to find the piece of content you're looking for because the References module only provides an autocomplete text field. With 60,000+ news articles and 30,000+ images available to reference, Pennsylvania State University (PSU) needed a solution that would help organize all their content.

That's where References Dialog comes in

References Dialog is a handy module that builds on top of the References field and provides some much needed functionality for managing your reference fields. Right out of the box, you'll get the option to have 'Add', 'Edit', and 'Search' links that show up on your reference field. These links will trigger a pop up modal (sub window) to perform their action without having to navigate away from your node edit form. Here's an example of a field with all 3 enabled:

Example of a reference field with the add and edit links

 

You'll notice, however, that the search button appears to be missing.

So how do we get it to show up?

Along with the additional options to reference fields, References Dialog also provides a new Views display called "References Dialog Search." Now you can create or edit a view, add a new display of type references dialog search, and start laying out the fields to your liking. I personally find the table layout works best for search dialog views because it allows for easily sorting and scanning over content.

Now we need to hook up the view to the field. It's counter-intuitive, but the view references the field, as opposed to the field referencing the view. Click on the 'Attached to' field on the view...

 pointtofield

Add the fields you want the search view to show up on. Note that you don't need to filter the view by content type to match what the field accepts, that's handled automatically. This allows you to have one view that handles every reference field you have.

Now when we go back to our field, there will be a search button right below! If there isn't, be sure to clear your cache, as the list of fields that the view references is cached for performance. I've taken the liberty of adding a few exposed filters to my view, so now we have a searchable, sortable table in which to find the content we're looking for. Slap on some simple styles to make the filters nicely organized, and your content editors will be singing your praises.

Image of the final product, a table with filtering capabilities.

Have you used Reference Dialog to help content editors before? Tell me about your experience!

William O'Beirne