I also created an issue in the media module, but it's specifically deals with plupload, so this may be a better spot. I need to add a spinet of html (a sentence with a few icons in it) that will show on the "upload" tab above the Filename drag and drop upload box. Without hacking the module is there an easy way to do this? Here is a link to the issue in the media module as well. http://drupal.org/node/1302754

I see some of the form elements are set explicitly in the media module for plupload

$form['upload']['#type'] = 'plupload';
$form['submit']['#value'] = t('Start upload');

Is there a way to add help text like this?

Comments

sol roth’s picture

Using hook form alter, I was able to add the perfect description to the media tab on the media gallery module (snippet is below), BUT the same technqiue applied to the main plupload form (the upload tab) using #prefix or #suffix from the forms api displays perfectly but causes a weird error when trying to upload items (nothing selected or invalid extension). Can I use form alter to modify the main upload form from plupload?

The code below works perfectly.

function YOURMODULE_form_media_internet_add_alter(&$form, &$form_state){

$form['edit-embed-code'] = array (

 '#prefix' => '
 <strong>Support Providers: <div class="providericons"></strong><img src="/sites/all/themes/customtheme/images/icons/youtube_16.png" alt="YouTube"> YouTube  <img src="/sites/all/themes/customtheme/images/icons/flickr_16.png" alt="Flickr"> Flickr </div>
 For each YouTube video or Flickr Image you want to add, please put the direct web address (URL) of the individual image or video in the box above and click submit. For example, a correct YouTube web address (URL) would be http://www.youtube.com/watch?v=XXXXXXXX',

);

}

The code below displays perfectly, but causes the upload form not to work

function YOURMODULE_form_media_add_upload_multiple_alter(&$form, &$form_state){

$form['media-add-upload-multiple'] = array (

'#suffix' => 'glahhasdlfjasdlkfjasd',

}
slashrsm’s picture

Status: Active » Fixed

You can also use $element['#description'].

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.