Normal code to add some field to the template is:
<field name="examplevalue" type="text" default="" label="Example value" description="" />
I need something like this but dynamicly, because of this needs i imported in backend of my template 1 js file which is: admin.js, i insert in my control group a new span element:
$('#attrib-example-control-group').append('<span id="addnewvalue">add new value</span>');
Then i added a new action for this button also trough admin.js:
$('#addnewvalue').on('click', function () {
$('#attrib-example-control-group').append('<div class="control-group">\n\
Example value: <input type="text" name="newexamplevalue" id="newexamplevalue" />\n\
</div>');
});
What i tried:
- Give standard xml parameter for template fields
<field>
- Tried to copy html output of already existing values, renamed it and tried to save
I have now method how i add this fields, but my problem is how to save it successful?
<fields name="params">
?