Re-write Output from the Drupal 7 Media Module

Re-write Output from the Drupal Media Module

One of the great things with Drupal is the ability to over-write just about anything!

We had a question in our support forums this week which put that ability to the test.

Our member wanted to provide a way for her clients to upload a PDF into a node and allow her users to easily download them. However, instead of a PDF icon and the title of the PDF, she wanted the link to say “Download PDF”.

She had already created the content type and a file upload which used the Media module. The Media module is perfect for her clients who are not highly technical.

The problem was that our member’s version of Media doesn’t allow for re-writing the output without digging into the code, which she didn’t want to do..

Display Suite and Views to the Rescue

Using a fairly simple view, we were able to insert the re-written link into the node via Display Suite.

If you’re not familiar with either of these modules, we have Views and Display Suite classes for our members here at OSTraining.

Below is a quick tutorial on creating the override:

Author

  • Rod Martin

    Rod holds two masters degrees and has been training people how to do "things" for over 25 years. Originally from Australia, he grew up in Canada and now resides just outside Cincinnati, Ohio. He has worked in both the non-profit and for-profit worlds, in small companies and large corporations. His extensive open source experience includes WordPress, Joomla and Drupal and he really knows how to help you get the most out of the system you chose. Rod plays ice hockey a couple of times a week and rides his Goldwing motorcycle pretty much everywhere he can.

    View all posts
0 0 votes
Article Rating
Subscribe
Notify of
guest

7 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
hgurol
hgurol
10 years ago

Is there anyway to do this without the Display Suite. Display Suite is a very big and complex module. If you don’t have it already installed for another reason, it is a very expensive solution to achieve the goal for this tutorial Any other light weight alternative you can think off?

steve
steve
10 years ago
Reply to  hgurol

Hi hgurol, see below for Jean-Francois idea …

Jean-Francois Bohemier
Jean-Francois Bohemier
10 years ago

I believe you can achieve the same with just EVA (Entity Views Attach). It attaches a view to an entity – node content in this case.

steve
steve
10 years ago

Hi Jean-Francois. Nice idea, thanks. Sounds like a potential follow-up tutorial to us …

Jean-Francois Bohemier
Jean-Francois Bohemier
10 years ago
Reply to  steve

Hi Steve, and thanks for the tutorials 🙂

I really like EVA. I use it in many places… It creates a field in your content’s display settings, so you can put it anywhere you want, then it attaches a view to that field.

steve
steve
10 years ago

Smart thinking, thanks Jean-Francois

steve
steve
10 years ago
Reply to  steve

Hi Jean-Francois
It took while, but we followed up on your idea: [url=http://www.ostraining.com/blog/drupal/entity-views-attach/]http://www.ostraining.com/b…[/url]
Thanks!

7
0
Would love your thoughts, please comment.x
()
x