2012-08-10 124 views
0

我有可能使用Liquid語言編輯在線商店頁面。接觸的網頁編碼這種方式默認爲:如何將自定義字段添加到Liquid表單上?

(這是storenvy.com店)

<fieldset> 
{% if contact.sent %} 
<div id="request_received"> 
<img src="images/support_received.png" /> 
<h2>Support request received!</h2> 
<p>Your request was received. We will take care of your issue as soon as possible.<br />Thank you!</p> 
</div> 
{% else %} 
<form id="contact-form" method="post" action ="/contact"> 
<ul> 
    <li> 
    <div class="label" id="first_label"> 
     <label for="name">Name</label> 
    </div> 
    <div class="field" id="first_field"> 
     {{ contact | contact_input: 'name'}} 
    </div> 
    </li> 
    <li> 
    <div class="label"> 
     <label for="email">Email</label> 
    </div> 
    <div class="field"> 
     {{ contact | contact_input: 'email'}} 
    </div> 
    </li> 
    <li> 
    <div class="label"> 
     <label for="phone">Phone</label> 
    </div> 
    <div class="field"> 
     {{ contact | contact_input: 'phone'}} 
    </div> 
    </li> 
    <li> 
    <div class="label"> 
     <label for="order_number">Order Number</label> 
    </div> 
    <div class="field"> 
     {{ contact | contact_input: 'order_number'}} 
    </div> 
    </li> 
    <li> 
    <div class="label"> 
     <label for="message">Details</label> 
    </div> 
    <div class="field"> 
     {{ contact | contact_input: 'message'}} 
     <label class="instruction">Please provide all the information you possibly can. </label> 
    </div> 
    </li> 
    <li> 
    <div class="label"> 
     <label for="captcha">Spam Protection</label> 
    </div> 
    <div class="field"> 
     {{ contact.captcha }}<br/> 
     {{ contact | contact_input: 'captcha' }} 
    </div> 
    </li> 
    <li> 
    <div class="submit"> 
     <input type="submit" value="Submit" class="button" /> 
    </div><!-- end .submit --> 
    </li> 
</ul> 
</form> 
{% endif %} 
</fieldset>​ 

是否有可能對我來說,自定義字段添加到該表單?或者這是由底層服務器邏輯決定的?

你能不能解釋一下,id="field"的結構是做什麼的?字段名稱在哪裏?

回答

0

這是一個有趣的形式,我從來沒有見過的形式這樣做的方式,但它看起來對我來說,都在這個頁面中的字段的格式是這樣的:

<li> 
    <div class = "foobar"> 
    // Label and Such 
    </div> 
    <div class="field"> 
    // Actual input 
    </div> 
</li> 

它也像這與你的CSS真的很相關,我們可以看到它的樣子嗎?

-Brian

相關問題