Samples Our templates Create and update our samples build.html {% if sampleId is not defined %}{% set sampleId = null %}{% endif %} {% if sample is not defined %} {% if sampleId %} {% set sample = craft.sample.getSample(sampleId) %} {% if not sample %}{% exit 404 %}{% endif %} {% else %} {% set sample = null %} {% endif %} {% endif %} {% set content %} <h1>Build a new sample</h1> <form method="post" action=""> <input type="hidden" name="action" value="sample/save" /> <input type="hidden" name="redirect" value="{{ url('sample') }}" /> <input type="hidden" name="sampleId" value="{{ sampleId }}" /> {{ forms.textField({ label: 'Sample Name'|t, required: true, name: 'name', id: 'name', value: sample ? sample.name : null, instructions: 'What should this sample be named?' }) }} {{ forms.textareaField({ label: 'Sample Description'|t, required: false, id: 'desc', name: 'desc', rows: '5', value: sample ? sample.desc : null, instructions: 'Provide a short write up about this sample' }) }} <div class="buttons"> <input type="submit" class="btn submit" value="{{ 'Save'|t }}"> </div> </form> {% endset %}