Answers.Body: <p>You have created a new template or customized one, right? Do you already have the address data available in your template? You can check this by making sure debugging is switched on in your environment and then access your BillingBlock.tpl but add <code>&amp;smartyDebug=1</code> at the end of the url.
  If not, you can use the API to retrieve the address data, assuming you know the contact id. In Smarty you can do:</p>
  
  <pre><code>{crmAPI var='result' entity='Address' action='get' q='civicrm/ajax/rest'}
  {foreach from=$result.values item=Address}
    &lt;li&gt;{$Address.some_field}&lt;/li&gt;
  {/foreach}
  </code></pre>
  
  <p>This will allow you to retrieve the supplemental address.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-05T00:03:02.630Z
Answers.Text: I am using a custom BillingBlock.tpl, except it is from version 4.5 - I like the way this template spits each field out individually as it's easier for a civi novice like me to customise.
Answers.UserDisplayName: jptaranto
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-05T00:03:24.837Z
Answers.Text: Anyway I've run smartydebug and there is no supplemental address field inside the `$billingDetailsFields` array. With the code you added pasted into the tpl I was able to get some values of the supplemental address field to print out using the id of `supplemental_address_1`.
Answers.UserDisplayName: jptaranto
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-05T00:03:35.453Z
Answers.Text: I'm still not sure how to print the field in the template so users can enter their information into the form. The other billing fields are printed as so:
  
   `{assign var=n value=billing_street_address-$bltID}
  <div class="crm-section {$form.$n.name}-section">
  <div class="label">{$form.$n.label} {$reqMark}</div>
  <div class="content">{$form.$n.html}</div>
  <div class="clear"></div>
  </div>`
Answers.UserDisplayName: jptaranto
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-05T07:09:11.827Z
Answers.Text: Your question was how to show, not how to enter data? So my answer tells you how to show the field. Entering data is a different ballgame. You will need to use CiviCRM hooks to do that, (PHP customization). In a template you can create an input field but you also need to save the data. Do you want to get into the details of this customization?
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-05T22:20:23.973Z
Answers.Text: Sorry, I should have worded it differently. I realise it is probably pretty tricky but it would be great if you could provide some examples. I'm sure it would be pretty handy to a few people.
Answers.UserDisplayName: jptaranto
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-04T06:43:44.283Z
Answers.LastActivityDate: 2015-08-04T06:43:44.283Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>If you want to add an input field it is important first to establish if this is a form (where stuff can be edited like edit a contact) or a page (showing stuff like the contact summary). I assume you are referring to a form where you can already edit stuff. </p>
  
  <p>There are several ways in which you could put a new input field on a form, this is what I tend to do:</p>
  
  <p>Create a new extension (or use an existing one) with civix as documented here : <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension" rel="nofollow">http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension</a></p>
  
  <p>Then create a template for the field(s) and include some jQuery that moves the  to the appropriate spot, like so:</p>
  
  <pre><code>&lt;div id="maf-earmarking" class="crm-summary-row"&gt;
    &lt;div class="crm-label"&gt;{$form.earmarking.label}&lt;/div&gt;
    &lt;div class="crm-content crm-recurring-earmarking"&gt;{$form.earmarking.html}   
    &lt;/div&gt;
  &lt;/div&gt;
  {literal}
    &lt;script type='text/javascript'&gt;
      cj("#whateveridyouhaveseenontheciviform").parent().append(cj("#maf-
        earmarking"));
    &lt;/script&gt;
  {/literal}
  </code></pre>
  
  <p>Finally add the element to the form using the buildForm hook in .php like so:</p>
  
  <pre><code>$earMarkings = array(0 =&gt; ts('- select -')) + _recurring_getOptionList('earmarking');
  $form-&gt;add('select', 'earmarking', ts('Øremerking'), $earMarkings, true);
  </code></pre>
  
  <p>In this example a select box is added, if you want to add an input fields, use $form->add('text'....</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-06T06:50:35.113Z
Answers.LastActivityDate: 2015-08-06T06:50:35.113Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I'm using CiviCRM 4.6 with Drupal 7 and have added the Supplemental Address Field 1 in CiviCRM but I can figure out how to get it to show in my custom BillingBlock.tpl</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-08-04T00:41:38.140Z
Comments.Text: Related: *[Where to modify billing information form ≥ 4.6?](http://civicrm.stackexchange.com/questions/2183)*
Comments.UserDisplayName: choster
Tags: <drupal><addresses>
Title: Add supplemental address field 1 to BillingBlock.tpl
ThreadText: # Add supplemental address field 1 to BillingBlock.tpl
  
  (Asked by: username_0 on 2015-08-04)
  
  I'm using CiviCRM 4.6 with Drupal 7 and have added the Supplemental Address Field 1 in CiviCRM but I can figure out how to get it to show in my custom BillingBlock.tpl
  
  **Tags:** drupal, addresses
  
  > **Comments:**
  > **username_1**: Related: *[Where to modify billing information form ≥ 4.6?](http://civicrm.stackexchange.com/questions/2183)*  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-08-04. Score: 1
  
  You have created a new template or customized one, right? Do you already have the address data available in your template? You can check this by making sure debugging is switched on in your environment and then access your BillingBlock.tpl but add &smartyDebug=1 at the end of the url.
  If not, you can use the API to retrieve the address data, assuming you know the contact id. In Smarty you can do:
  {crmAPI var='result' entity='Address' action='get' q='civicrm/ajax/rest'}
  {foreach from=$result.values item=Address}
    {$Address.some_field}
  {/foreach}
  
  This will allow you to retrieve the supplemental address.
  
  > **Comments:**
  > **username_0**: I am using a custom BillingBlock.tpl, except it is from version 4.5 - I like the way this template spits each field out individually as it's easier for a civi novice like me to customise.  
  > **username_0**: Anyway I've run smartydebug and there is no supplemental address field inside the `$billingDetailsFields` array. With the code you added pasted into the tpl I was able to get some values of the supplemental address field to print out using the id of `supplemental_address_1`.  
  > **username_0**: I'm still not sure how to print the field in the template so users can enter their information into the form. The other billing fields are printed as so:   `{assign var=n value=billing_street_address-$bltID} <div class="crm-section {$form.$n.name}-section"> <div class="label">{$form.$n.label} {$reqMark}</div> <div class="content">{$form.$n.html}</div> <div class="clear"></div> </div>`  
  > **username_2**: Your question was how to show, not how to enter data? So my answer tells you how to show the field. Entering data is a different ballgame. You will need to use CiviCRM hooks to do that, (PHP customization). In a template you can create an input field but you also need to save the data. Do you want to get into the details of this customization?  
  > **username_0**: Sorry, I should have worded it differently. I realise it is probably pretty tricky but it would be great if you could provide some examples. I'm sure it would be pretty handy to a few people.  
  
  ---
  
  ### Answer by username_2 on 2015-08-06. Score: 1
  
  If you want to add an input field it is important first to establish if this is a form (where stuff can be edited like edit a contact) or a page (showing stuff like the contact summary). I assume you are referring to a form where you can already edit stuff. 
  There are several ways in which you could put a new input field on a form, this is what I tend to do:
  Create a new extension (or use an existing one) with civix as documented here : http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension
  Then create a template for the field(s) and include some jQuery that moves the  to the appropriate spot, like so:
  
    {$form.earmarking.label}
    {$form.earmarking.html}   
    
  
  {literal}
    
  {/literal}
  
  Finally add the element to the form using the buildForm hook in .php like so:
  $earMarkings = array(0 => ts('- select -')) + _recurring_getOptionList('earmarking');
  $form->add('select', 'earmarking', ts('Øremerking'), $earMarkings, true);
  
  In this example a select box is added, if you want to add an input fields, use $form->add('text'....
  
  
  ---
  
  