Note that there are some explanatory texts on larger screens.

plurals
  1. PODrupal Imagfield/Filefield in custom form
    text
    copied!<p>i have created a module with this among others this function in it:</p> <pre><code>&lt;?php function ils_ladda_upp_form() { $form['upload'] = array( '#method' =&gt; 'post', '#attributes' =&gt; array( 'enctype' =&gt; 'multipart/form-data', ) ); $form['upload']['album_name'] = array( '#type' =&gt; 'textfield', '#title' =&gt; t('Albumnamn'), '#required' =&gt; 1 ); $form['upload']['album_location'] = array( '#type' =&gt; 'textfield', '#title' =&gt; t('Plats'), ); $form['upload']['album_date'] = array( '#type' =&gt; 'date', '#title' =&gt; t('Datum'), '#required' =&gt; 1, '#suffix' =&gt; '(då bilderna togs)' ); $form['upload']['album_description'] = array( '#type' =&gt; 'textarea', '#title' =&gt; t('Beskrivning'), '#resizable' =&gt; false, ); $form['upload']['school'] = array( '#type' =&gt; 'hierarchical_select', '#title' =&gt; t('Skola &amp; Klass'), '#size' =&gt; 1, '#required' =&gt; 1, '#config' =&gt; array( 'module' =&gt; 'hs_taxonomy', 'params' =&gt; array( 'vid' =&gt; 1, ), 'save_lineage' =&gt; 0, 'enforce_deepest' =&gt; 0, 'entity_count' =&gt; 0, 'require_entity' =&gt; 0, 'resizable' =&gt; 0, 'level_labels' =&gt; array( 'status' =&gt; 0, 'labels' =&gt; array( 0 =&gt; t('Main category'), 1 =&gt; t('Subcategory'), 2 =&gt; t('Third level category'), ), ), 'dropbox' =&gt; array( 'status' =&gt; 0, 'title' =&gt; t('All selections'), 'limit' =&gt; 0, 'reset_hs' =&gt; 1, ), 'editability' =&gt; array( 'status' =&gt; 0, 'item_types' =&gt; array(), 'allowed_levels' =&gt; array( 0 =&gt; 0, 1 =&gt; 0, 2 =&gt; 1, ), 'allow_new_levels' =&gt; 0, 'max_levels' =&gt; 3, ), # These settings cannot be configured through the UI: they can only be # overridden through code. 'animation_delay' =&gt; 400, 'special_items' =&gt; array(), 'render_flat_select' =&gt; 0, 'path' =&gt; 'hierarchical_select_json', ), #'#default_value' =&gt; '83', ); $form['upload']['file'] = array( '#type' =&gt; 'file', '#title' =&gt; t('Bild'), ); $form['upload']['name'] = array( '#type' =&gt; 'textfield', '#required' =&gt; true, '#title' =&gt; t('Ditt namn') ); $form['upload']['submit'] = array('#type' =&gt; 'submit', '#value' =&gt; t('Ladda upp')); return $form['upload']; } ?&gt; </code></pre> <p>Is it possible to insert a CCK Filefield/imagefield in the form? If so, how do i do it?</p> <p>Drupal v. 6.15</p> <p>Regards,<br> Joar</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload