Hello,
I'm trying to make an editable field have unique default text which is generated by an addon.
So I wrote an addon, and it works. However I noticed that the code executes also when I visit the template's cloned page. Since it does some database querying, I want that particular block of code to execute only when I'm creating a new cloned page in the admin panel.
This is how I'm doing it in a template:
I really can't think of how to do it...
I'm trying to make an editable field have unique default text which is generated by an addon.
So I wrote an addon, and it works. However I noticed that the code executes also when I visit the template's cloned page. Since it does some database querying, I want that particular block of code to execute only when I'm creating a new cloned page in the admin panel.
This is how I'm doing it in a template:
- Code: Select all
<cms:editable
name='tool_barcode'
label='Barkodas'
type='text'
order='4'
group='tool_main_info_group'>
<cms:generate-code field_name='tool_barcode' />
</cms:editable>
I really can't think of how to do it...