Created
March 12, 2023 14:53
-
-
Save 0xcrypto/3b52315e4829ddcfb446d20096bc4ef8 to your computer and use it in GitHub Desktop.
Test page script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro errorList(errors) %} | |
{% if errors %} | |
<ul class="errors"> | |
{% for error in errors %} | |
<li>{{ error }}</li> | |
{% endfor %} | |
</ul> | |
{% endif %} | |
{% endmacro %} | |
{% from _self import errorList %} | |
<form method="post" accept-charset="UTF-8" enctype="multipart/form-data"> | |
{{ csrfInput() }} | |
<input type="hidden" name="action" value="guest-entries/save"> | |
<input type="hidden" name="sectionId" value="2"> | |
<input type="hidden" name="enabled" value="1"> | |
{{ redirectInput('{uri}') }} | |
<label for="title">Title</label> | |
<input id="title" type="text" name="title" | |
{%- if entry is defined %} value="{{ entry.title }}"{% endif -%}> | |
{% if entry is defined %} | |
{{ errorList(entry.getErrors('title')) }} | |
{% endif %} | |
<input type="file" name="fields[asset]"> | |
<input type="submit" value="Publish"> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment