Using Forms in Templates

Templates provide the page display logic. Use templates to process form field elements or actions as entered in the browser. Templates use:

  1. Refer to the example data in Creating a Form Definitions.
  2. Create a template sendstuff.isml. This template uses form data object references to render browser entry details and validate customer entry for the following checkbox fields:
    • catalogSend
    • emailSend
  3. Enter these lines in the template header:
    <isdecorate template="pagetypes/pt_service">
    <iscontent type="text/html" charset="UTF-8" compact="true">
  4. Enter these lines, which includes the util/modules template, which processes < isinputfield> calls.
    <isinclude template="util/modules">
    <div id="service">
  5. Enter these lines, which defines browser message display.
    <div class="editprofile">
    <form action="${URLUtils.httpsContinue()}" method="post" id="apply">
  6. Enter the following lines. The isinputfield tag renders an input field using the field definitions in sendstuff form. When the HTML form is submitted, the user values are accessible from the CurrentForms.sendstuff object in the Pipeline Dictionary.
    The < isinputfield> element renders input fields in SiteGenesis.
    <div id="sendstuff">
    		<table class="simple">
    			<tr><isinputfield formfield="${}" type="checkbox"></tr>
    			<tr><isinputfield formfield="${pdict.CurrentForms.sendstuff.catalog}" type="checkbox"></tr>
  7. Enter the following lines, which represent a browser action (button).
    				<div id="editprofile">
    						<input class="image imageright" 
    						          src="${URLUtils.staticURL('/images/bttn_apply.gif')}" />
  8. Continue with this example: Using Form Pipelets.

These are other examples of how Salesforce B2C Commerce forms are accessed in templates.

<input> Element

Reads the coupon code.

<input type="text" class="couponinput" name="${pdict.CurrentForms.cart.couponCode.htmlName}" 

<isif> Element

Checks if the current customer is registered.

<isif condition="${pdict.CurrentCustomer.registered}">  

<isprint> Element

Prints the phone number portion of the address.

<isprint value="${}">"  

<isinputfield> Element

Reads the first name from the customer address.

<isinputfield formfield="${pdict.CurrentForms.profile.address.firstname}" type="input">  

<isloop> Element

Loop reads product options from the form.

<isloop items="${lineItem.optionProductLineItems}" var="oli">  

<select element>

Displays select box for "edit addresses" for the Wish List page.

<select class="selectbox" name="editAddress" id="editAddress"> 
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.