JelleG Posted September 7, 2016 Share Posted September 7, 2016 Hi, Currently inside the cart file /templates/orderforms/template/configuredomains.tpl I want to change the {$domainfield} . This is currently load like the following: <input type="text" name="domainfield[0][0]" value="" size="20" class="form-control input-250 input-inline"> * Personal Identification Number (or Organization number), if you are an individual registrant (or organization) in Sweden I want to load the field information, that is currently load after the <input> as a placeholder. How can I change this, so this is load as a placeholder? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 7, 2016 Share Posted September 7, 2016 How can I change this, so this is load as a placeholder? with difficulty! if you had just wanted to use {$domainfieldname} as the placeholder, then that would have been easier - you would have just needed to replace... <div class="col-sm-8">{$domainfield}</div> with... <div class="col-sm-8">{if $domainfield|strpos:'<input type="text"'===0}{$domainfield|replace:"/>":" placeholder=\"`$domainfieldname`\"/>"}{else}{$domainfield}{/if}</div> however, you want to use part of the variable output as the placeholder value - that's slightly trickier to do and requires more advanced Smarty coding.. {assign domainph $domainfield|replace:"/>":" placeholder=\"{$domainfield|strstr:'/>'|replace:'/>'|substr:1}\"/>"|strstr:'/>':true|cat:'/>'} <div class="col-sm-8"> {if $domainfield|strpos:'<input type="text"'===0} {if $domainph|strstr:'placeholder=""'} {$domainfield|replace:"/>":" placeholder=\"`$domainfieldname`\"/>"} {else} {$domainph} {/if} {else} {$domainfield} {/if} </div> what this will do is first check if the output is a text field - if it's not (dropdown, checkbox etc), it will output the field as normal; if it is a text field, it will use the additional domain field description (if one exists) as the placeholder... if there is no description (tested with .fr as some fields there have no descriptors), then it uses $domainfieldname as a placeholder... you can change that to leave it empty if that's what you want to do. i've quickly tested this on .nu (your example TLD) and it works fine... and for .fr/.ru too. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.