Custom Fields

Consider a standard new entry form, like so

<form action="{{rusic.permalink}}/ideas" method="post">
  <p>
    <label for="idea_title">Idea title</label><br />
    <input type="text" name="idea[title]" class="title" id="idea_title" placeholder="Entry title" />
  </p>
  <p>
    <label for="idea_content">Content</label><br />
    <textarea name="idea[content]" id="idea_content"></textarea>
  </p>
  <p>
    <input type="checkbox" name="idea[should_post_to_social]" value="1" checked /> Post this entry to {{current_user.provider}}?
  </p>
  <p>
    <input type="submit" value="Submit">
  </p>
</form>

You can easily add any number of arbitrary named custom fields. For example, this will add a custom field called email_address

<p>
  <label for="idea_custom_email_address">Email address</label><br />
  <input type="text" name="idea[custom][email_address]" id="idea_custom_email_address" />
</p>

Once the entry is saved you can access all custom fields through the idea.custom liquid method, like so:

{{idea.custom.email_address}}

Page Contents

Back to top