I'm using Media module (2.x dev) and I have to make a critical desicion on set-up, choosing between:
a) Set-up one media field in content type allowing both IMAGES and DOCUMENTS, or
b) Set-up two media fields in content type, one for IMAGES and one for DOCUMENTS.
If I go along with first option (a) I need to add a visibility rule in ctools pages (using panels) so that only DOCUMENTS are displayed (I'll make a similar rule for IMAGES)... Reason for this is that IMAGES are displayed above my "body text" and "DOCUMENTS" are displayed in a right block on my panels.
So, if I'll assume correctly that setup-up "a" is more elegant -- does anyone have a decent PHP-code that evalues TRUE if the file is DOCUMENT?
My attempt so far is to look at the url, I currently only allow pdf so if the url ended with .pdf it is a "document" and should pass the visibility rule. I put below code as PHP in "visibility rule" (without the <? php ?>) but it does not pass as TRUE.
substr( $url, strrpos( $url, '.' )+1 ) == 'pdf'
You can see for yourself what I'm doing at: http://brforesundsdammarna.se/node/20
I only want the "book1.pdf" file to show, the jpg file "4_slottsparken.jpg" should be hidden by the "visibility rule".
Really appreciate if someone could help me set this straight! :>