Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    88
    Thanks
    10
    Thanked 0 Times in 0 Posts

    strange type of form {$form.u.html}

    Hello all,

    I'm busy with altering a for to fit my needs, but at the moment I'm stuck on a dead end.

    There is a form wich I can not alter because I never see them before.

    Code:
    <form {$form.attributes} class="s6l_short_url_form">
        {$form.hidden}        
        
        <div>
          {if $form.u.error} <span class="s6l_error_message">{$form.u.error}</span> {else} {$form.u.label} {/if}
          {$form.u.html}&nbsp;&nbsp;
          {$form.submit.html}
          &nbsp;<a href="?a=y">{$txt_advanced}</a>
        </div>
        {if $show_advanced_settings}
          <div style="margin-top:10px;">
             {if $form.u_id.error} <span class="s6l_error_message">{$form.u_id.error}</span><br />{else}{/if}
             {$form.u_id.label}&nbsp;
             {$form.u_id.html}&nbsp;&nbsp;
          </div>
        {/if}
        </form>
    Can somebody explain to me what this is and how I can edit it?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,863
    Thanks
    6
    Thanked 1,028 Times in 1,001 Posts
    The stuff in curly brackets looks like Smarty variables. Basically the HTML for hidden input fields is stored somewhere (in a database? in other files to be included?) and defined in such variables so it can be reused or altered multiple times or in different places. Also, there are some conditional statements, again in Smarty syntax.

    What you can do in the form code above is change the plain HTML but you should leave the smarty code as is. You can see the HTML output of it if you view the source in your browser. (P. S.: The hidden input fields must be in some block element, they can’t be direct children of the form. So for example do <div>{$form.hidden}</div>)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •