Jump to content

How to customize form inputs in Starter Theme?


Recommended Posts

Hi there.

I am trying to modify how input tags for the login form are rendered in file /templates/customer/_partials/login-form.tpl, and found this code that generates them:

{block name='form_fields'}
	{foreach from=$formFields item="field"}
		{block name='form_field'}
			{form_field field=$field}
		{/block}
	{/foreach}
{/block}

Now I want to change the HTML of these inputs, mostly to insert new attributes on them (classes, placeholders maybe... whatever). How can this be achieved?

Link to comment
Share on other sites

  • 4 years later...

Hi,

I'm trying to figure out where I need to define the placeholder text?

I have th below code that implements the attribute, but I have no clue where I would define the text for the placeholder so that it would exist in {$field.availableValues.placeholder} for the field I want?

 

      {else}
        {block name='form_field_item_other'}
          <input
            class="form-control"
            name="{$field.name}"
            type="{$field.type}"
            value="{$field.value}"
            {if isset($field.availableValues.placeholder)}placeholder="{$field.availableValues.placeholder}"{/if}
            {if $field.maxLength}maxlength="{$field.maxLength}"{/if}
            {if $field.required}required{/if}
          >
          {if isset($field.availableValues.comment)}
            <span class="form-control-comment">
              {$field.availableValues.comment}
            </span>
          {/if}
        {/block}
      {/if}

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...