1

Currently I have a field that allows unlimited values, and it's displayed as a video player, using user-input URL from that field. Now I would like to do some custom coding or whatever it takes to somehow pick the first URL (the one at the very top), so I can have the video player play only one URL. Any ideas?

0

In a multi-value text field, and assuming D7, the values are something like this:

// if set, this is the first value...
$node->FIELD_NAME[$node->language][0]['value']
// if at least one set, this is the last value...
$node->FIELD_NAME[$node->language][count($node->FIELD_NAME[$node->language])-1]['value']

so depending on what you mean by 'on top,' one of these values is most probably what you are looking for. (If D6, just take out the [$node->language] part)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.