Closed (fixed)
Project:
Custom Formatters
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Nov 2011 at 11:28 UTC
Updated:
4 Jan 2014 at 01:11 UTC
Jump to comment: Most recent
Comments
Comment #1
decipheredHi,
Obviously asking in the issue queue of the Custom Formatters how to do something in the Views module is unlikely to get a response, that sort of thing would be best to ask in the Views module or the Media module.
I can certainly help you with Custom Formatters though.
It should be doable with HTML + Tokens, but unfortunately Field tokens are a bit of a cluster f**k in drupal 7, so I'll demo briefly how to do it with the PHP engine:
1. Make sure the Devel module is installed and enabled
2. Make a new PHP formatter for the 'file' field.
3. In the code field, simply type:
return;4. Open the preview section, chose your field and an entity and hit the preview button
5. In the debug code you will see all the available data, inside of #items is a list off all the file fields on that entity, each containing the data you need.
6. Use the data to write a Formatter.
There's two example formatters provided with the module, and plenty more can be found at CustomFormatters.com that should help you achieve what you need.
I am also working on improving Field Token support in the upcoming release, but there's no guarantee as I am just consuming tokens defined by other modules and as I said, current state is not good.
Hope this helped.
Cheers,
Deciphered.