Skip to Content

Data Reuse

In this analysis, we consider how content data can or will be used outside the node to which it was originally assigned. When you make a decision to use a content management system as flexible as Drupal, you have the opportunity to capture content once and reuse it. We saw an example of this when we considered content sources.

Decisions made during this analysis can affect

  • your decisions around how you capture your data
  • strategies you use for uploading content
  • the way you display your content.

Reasons to Reuse

The most obvious reason to reuse is to reduce or eliminate the need to maintain the same text or image in more than one place. We saw an example of this when we considered content sources in the previous section. Below are four more reuse strategies to consider.

Latest posts

The Views module can be used to query the database and show the latest nodes added to the site. The query results can be displayed in a block or in a page. The list of posts can sow whatever field you have assigned to the content type.
For instance, you might have an event date in your event content type that you want to include in a list of latest events added to the site. Because you chose not to type the date information into the body of the node, you can use the date field as part of the data being displayed from the query.

Highlighted posts

This works on the same concept as the latest posts but with a twist. Assume you want to show part of a node in block on your home page. You want include the title of the node and a marketing statement, something catchy to convince your audience this is worth looking at. This is similar to what you might hear on a commercial for the news “Cat rescued from fire, news at 11:00.”

There are several ways you can do this. One way would be to add a field to your content type called “advertisement blurb” and then when you select the fields you want to show in your block, you select the title and this field.

Advertisements

Assume you are hosting nodes that are advertisements for your clients. The node contains an image, the ad promotion (Get 20% off when you …), the name and location of the business, the expiration date, and maybe some other information as well. You can’t very well show all this in a block on other related pages so you create a block with just the image and link it to the ad.

If you upload the image into a field, you can create a query on the database to find the node in question and only show the image. You could use a module to automatically resize the image in the block so you don’t have to create multiple versions of the ad image. If you choose to use HTML to embed the image into the body of the node and not assign it to a field, you won’t be able to reuse the image in the ad block.

Conclusion

The question you want to ask yourself is “When I create a node, is there any data in the node that I would want to use again someplace else?” If will be hard to imagine this if you haven’t done it before. Hopefully the examples above offer some inspiration to your planning endeavors.