Edited for verbosity - sorry, I tend to be too longwinded.

I've set up a simple content type for an "audiomix" on a website. This custom content type includes two fields - one is a file upload with mp3player, while the other is a URL field which points to the file that should be played. On the nodes themselves, I've set up a simple template (node-audio.tpl.php) which either displays the filefield mp3player, OR displays the mp3player (via custom code with the URL replaced automatically with the URL field data). Basically, site users either upload the file manually or specify where the file is located, and the node automatically displays a working swf mp3player. Works like a charm on node pages.

Now then - I'm trying to set up a simple view to display a list of the "audiomixes" that are available through the site. I've enabled the "audiofile" and "audioURL" fields (although they are "excluded from display") and was hoping to use the customfield php in a similar method as I used for the node template itself for the MP3 player code (simply substituting either the file-field-url or the Url-field in the mp3 player snippet).

I can't for the life of my figure out how to do this though. There doesn't seem to be any easy way to transfer that file OR URL information into the php (mp3player function). There doesn't seem to be anything related to the filefield-mp3 information when printing the data array.

Edit: HOWEVER - I've clearly been going about this the wrong way. I found the answer for what I was looking for in the form of the "Filefield Sources" module. (Instead of specifying the url manually via an url field, I can just use the same filefield and specify the source differently. Exactly what I needed!

Sorry again for the length of my request, especially if inappropriate for this forum. (I find the php field a bit more confusing than other modules, but luckily in this case I didn't need to use it.)

Comments

Hipples’s picture

Priority: Normal » Minor
Status: Active » Closed (works as designed)
Hipples’s picture

Priority: Minor » Normal
Status: Closed (works as designed) » Active

Gah - I spoke too soon. RE-opening this issue.

The reason I can't use the "filefield sources" module is that the file is too large for the file field (and for the php memory limit imposed by our server). Manual uploads (via ftp) work just fine though, so the URL field works (embeded into the mp3player) fine as an alternate.

So what I still need is a way to use the php custom field with views to either list the url from the url field, OR the url to the file field (if the url field is empty). And then... ideally, this field is fed into some simple mp3player function.

Please, any pointers in the right direction would be hugely appreciated.

Hipples’s picture

Issue summary: View changes

Issue resolved!