Skip to main content
Post Closed as "Duplicate" by avpaderno
Corrected spelling within the question's title to let other users with similar questions find it easier.
Link

adding for Adding form to .tpl

Changed formatting to read easily.
Source Link

This iis definitely being called

function studiga_theme_theme($existing, $type, $theme, $path) {    
    $items['add_property_form'] = array(
        'render element' => 'form',
        'template' => 'node--14',
        'path' => drupal_get_path('theme', 'studiga_theme') . '/templates/node',
    );

    return $items;
}

But which should set up the form fields isn't and I have no idea why

function studiga_theme_preprocess_add_property_form(&$variables) { 
 
  // Shorten the form variable name for easier access.
  $form = $variables['form'];
 
  $form['first_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('First name')),
    );
    $form['last_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Last name')),
    );
    $form['address'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Address')),
    );
    $form['city'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('City')),
    );
    $form['state'] = array(
        '#type' => 'select',
        '#options' => array(
            'default' => 'State',
            '...' => '...',
        ),
    );
    $form['zip'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Zip')),
    );
    $form['email'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Email')),
    );
    $form['phone'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Phone')),
    );
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Submit',
    );   
}

Thanks

This i definitely being called

function studiga_theme_theme($existing, $type, $theme, $path) {    
    $items['add_property_form'] = array(
        'render element' => 'form',
        'template' => 'node--14',
        'path' => drupal_get_path('theme', 'studiga_theme') . '/templates/node',
    );

    return $items;
}

But which should set up the form fields isn't and I have no idea why

function studiga_theme_preprocess_add_property_form(&$variables) { 
 
  // Shorten the form variable name for easier access.
  $form = $variables['form'];
 
  $form['first_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('First name')),
    );
    $form['last_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Last name')),
    );
    $form['address'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Address')),
    );
    $form['city'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('City')),
    );
    $form['state'] = array(
        '#type' => 'select',
        '#options' => array(
            'default' => 'State',
            '...' => '...',
        ),
    );
    $form['zip'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Zip')),
    );
    $form['email'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Email')),
    );
    $form['phone'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Phone')),
    );
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Submit',
    );   
}

Thanks

This is definitely being called

function studiga_theme_theme($existing, $type, $theme, $path) {    
    $items['add_property_form'] = array(
        'render element' => 'form',
        'template' => 'node--14',
        'path' => drupal_get_path('theme', 'studiga_theme') . '/templates/node',
    );

    return $items;
}

But which should set up the form fields isn't and I have no idea why

function studiga_theme_preprocess_add_property_form(&$variables) { 
 
  // Shorten the form variable name for easier access.
  $form = $variables['form'];
 
  $form['first_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('First name')),
    );
    $form['last_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Last name')),
    );
    $form['address'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Address')),
    );
    $form['city'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('City')),
    );
    $form['state'] = array(
        '#type' => 'select',
        '#options' => array(
            'default' => 'State',
            '...' => '...',
        ),
    );
    $form['zip'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Zip')),
    );
    $form['email'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Email')),
    );
    $form['phone'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Phone')),
    );
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Submit',
    );   
}

Thanks

Changed formatting to read easily.
Source Link

function studiga_theme_theme($existing, $type, $theme, $path) {
$items['add_property_form'] = array( 'render element' => 'form', 'template' => 'node--14', 'path' => drupal_get_path('theme', 'studiga_theme') . '/templates/node', );

function studiga_theme_theme($existing, $type, $theme, $path) {    
    $items['add_property_form'] = array(
        'render element' => 'form',
        'template' => 'node--14',
        'path' => drupal_get_path('theme', 'studiga_theme') . '/templates/node',
    );

    return $items;
}

}

But which should set up the form fields isn't and I have no idea why

function studiga_theme_preprocess_add_property_form(&$variables) {

// Shorten the form variable name for easier access. $form = $variables['form'];

$form['first_name'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('First name')), ); $form['last_name'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Last name')), ); $form['address'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Address')), ); $form['city'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('City')), ); $form['state'] = array( '#type' => 'select', '#options' => array( 'default' => 'State', '...' => '...', ), ); $form['zip'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Zip')), ); $form['email'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Email')), ); $form['phone'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Phone')), ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Submit', );
}

function studiga_theme_preprocess_add_property_form(&$variables) { 
 
  // Shorten the form variable name for easier access.
  $form = $variables['form'];
 
  $form['first_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('First name')),
    );
    $form['last_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Last name')),
    );
    $form['address'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Address')),
    );
    $form['city'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('City')),
    );
    $form['state'] = array(
        '#type' => 'select',
        '#options' => array(
            'default' => 'State',
            '...' => '...',
        ),
    );
    $form['zip'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Zip')),
    );
    $form['email'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Email')),
    );
    $form['phone'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Phone')),
    );
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Submit',
    );   
}

function studiga_theme_theme($existing, $type, $theme, $path) {
$items['add_property_form'] = array( 'render element' => 'form', 'template' => 'node--14', 'path' => drupal_get_path('theme', 'studiga_theme') . '/templates/node', );

return $items;

}

But which should set up the form fields isn't and I have no idea why

function studiga_theme_preprocess_add_property_form(&$variables) {

// Shorten the form variable name for easier access. $form = $variables['form'];

$form['first_name'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('First name')), ); $form['last_name'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Last name')), ); $form['address'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Address')), ); $form['city'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('City')), ); $form['state'] = array( '#type' => 'select', '#options' => array( 'default' => 'State', '...' => '...', ), ); $form['zip'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Zip')), ); $form['email'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Email')), ); $form['phone'] = array( '#type' => 'textfield', '#attributes' => array('placeholder' => t('Phone')), ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Submit', );
}

function studiga_theme_theme($existing, $type, $theme, $path) {    
    $items['add_property_form'] = array(
        'render element' => 'form',
        'template' => 'node--14',
        'path' => drupal_get_path('theme', 'studiga_theme') . '/templates/node',
    );

    return $items;
}

But which should set up the form fields isn't and I have no idea why

function studiga_theme_preprocess_add_property_form(&$variables) { 
 
  // Shorten the form variable name for easier access.
  $form = $variables['form'];
 
  $form['first_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('First name')),
    );
    $form['last_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Last name')),
    );
    $form['address'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Address')),
    );
    $form['city'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('City')),
    );
    $form['state'] = array(
        '#type' => 'select',
        '#options' => array(
            'default' => 'State',
            '...' => '...',
        ),
    );
    $form['zip'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Zip')),
    );
    $form['email'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Email')),
    );
    $form['phone'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Phone')),
    );
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Submit',
    );   
}
Source Link
Loading