{% set formMethod = (formMethod == 'get') ? 'get' : 'post' %}
{% set tag = (tag is empty) ? '' : tag %}
<form {% if method == 'edit' or method == 'editiframe' -%}
        id="ACEditor" name="ACEditor" enctype="multipart/form-data"
    {%- endif %}action="{{ url({tag:tag,handler:method}) }}" method="{{ formMethod }}"
    {%- if class is not empty %} class="{{ class }}"{% endif -%}
    >
    {%- if (method == 'edit' or method == 'editiframe') and
        (config.password_for_editing is not empty and 
        request.post.password_for_editing is not empty and 
        not (request.post.password_for_editing is iterable)) ~%}
        <input type="hidden" name="password_for_editing" value="{{ request.post.password_for_editing|e('html_attr') }}" />
    {%- endif ~%}
    {%- if not config.rewrite_mode and formMethod == 'get' ~%}
    <input 
        type="hidden" 
        name="wiki" 
        value="{{ url({tag:tag ?? ''})|replace({
            (url({tag:'not-existing-tag',handler:'iframe'})|slice(0,-'not-existing-tag/iframe'|length)):'',
            (url({tag:'not-existing-tag'})|slice(0,-'not-existing-tag'|length)):''
            }) }}"/>
        {# TODO define MiniHref in TemplateEngine #}
    {%- endif ~%}
