Re: Clone a Template [Support Thread]
Just had a first play with this (very useful) plugin with one of Anne's templates (Westminster New).
Whilst all store side files are being cloned just fine, none of the template specific admin files of this template are being dealt with (4 files in my example such as files in admin/includes/auto_loaders, admin/includes/init_includes and another couple of files).
So, these files still need to be cloned manually. Are there any plans to get this implemented in future versions of this plugin?
Thanks / Frank
Re: Clone a Template [Support Thread]
@lat9: Thank you for automating this tedious task.
Re: Clone a Template [Support Thread]
Great tool cindy! I found 1 small error, but maybe it is already fixed in the latest version
In "YOUR_ADMIN\clone_template.php" on line 203 there is an extra "</td>"
PHP Code:
<td class="spacing"><?php echo zen_draw_form ('choose_template', FILENAME_CLONE_TEMPLATE, '', 'post'); ?>
<?php echo '<b>' . TEXT_TEMPLATE_SOURCE . '</b>' . zen_draw_pull_down_menu ('template_source', $template_list_dropdown, $current_template_dir) . ' <b>' . TEXT_NEW_TEMPLATE_NAME . '</b>' . zen_draw_input_field ('cloned_name') . zen_draw_hidden_field ('copy_template', 'yes') . ' ' . zen_image_submit ('button_go.gif', CLONE_TEMPLATE_GO_ALT, 'onclick="return issueWarnings ();"'); ?></td>
</form></td>
this should be:
PHP Code:
<td class="spacing"><?php echo zen_draw_form ('choose_template', FILENAME_CLONE_TEMPLATE, '', 'post'); ?>
<?php echo '<b>' . TEXT_TEMPLATE_SOURCE . '</b>' . zen_draw_pull_down_menu ('template_source', $template_list_dropdown, $current_template_dir) . ' <b>' . TEXT_NEW_TEMPLATE_NAME . '</b>' . zen_draw_input_field ('cloned_name') . zen_draw_hidden_field ('copy_template', 'yes') . ' ' . zen_image_submit ('button_go.gif', CLONE_TEMPLATE_GO_ALT, 'onclick="return issueWarnings ();"'); ?>
</form></td>
Re: Clone a Template [Support Thread]
Quote:
Originally Posted by
swguy
@lat9: Thank you for automating this tedious task.
Absolutely! Thumbs up all around :clap::thumbsup::cheers:
Re: Clone a Template [Support Thread]
Quote:
Originally Posted by
frank18
Just had a first play with this (very useful) plugin with one of Anne's templates (Westminster New).
Whilst all store side files are being cloned just fine, none of the template specific admin files of this template are being dealt with (4 files in my example such as files in admin/includes/auto_loaders, admin/includes/init_includes and another couple of files).
So, these files still need to be cloned manually. Are there any plans to get this implemented in future versions of this plugin?
Thanks / Frank
Frank, this plugin has no way of knowing that a particular template has admin-level files that could also be "cloned". Now, if there was a standard naming convention for those admin-level files ... that would be a different answer!
Out of curiosity, to which template do you refer?
Re: Clone a Template [Support Thread]
Quote:
Originally Posted by
Design75
Great tool cindy! I found 1 small error, but maybe it is already fixed in the latest version
In "YOUR_ADMIN\clone_template.php" on line 203 there is an extra "</td>"
PHP Code:
<td class="spacing"><?php echo zen_draw_form ('choose_template', FILENAME_CLONE_TEMPLATE, '', 'post'); ?>
<?php echo '<b>' . TEXT_TEMPLATE_SOURCE . '</b>' . zen_draw_pull_down_menu ('template_source', $template_list_dropdown, $current_template_dir) . '####<b>' . TEXT_NEW_TEMPLATE_NAME . '</b>' . zen_draw_input_field ('cloned_name') . zen_draw_hidden_field ('copy_template', 'yes') . '####' . zen_image_submit ('button_go.gif', CLONE_TEMPLATE_GO_ALT, 'onclick="return issueWarnings ();"'); ?></td>
</form></td>
this should be:
PHP Code:
<td class="spacing"><?php echo zen_draw_form ('choose_template', FILENAME_CLONE_TEMPLATE, '', 'post'); ?>
<?php echo '<b>' . TEXT_TEMPLATE_SOURCE . '</b>' . zen_draw_pull_down_menu ('template_source', $template_list_dropdown, $current_template_dir) . '####<b>' . TEXT_NEW_TEMPLATE_NAME . '</b>' . zen_draw_input_field ('cloned_name') . zen_draw_hidden_field ('copy_template', 'yes') . '####' . zen_image_submit ('button_go.gif', CLONE_TEMPLATE_GO_ALT, 'onclick="return issueWarnings ();"'); ?>
</form></td>
Eek! Thanks, Design75, I'll get that bug noted and corrected in GitHub.
Re: Clone a Template [Support Thread]
Quote:
Originally Posted by
lat9
Frank, this plugin has no way of knowing that a particular template has admin-level files that could also be "cloned". Now, if there was a standard naming convention for those admin-level files ... that would be a different answer!
Out of curiosity, to which template do you refer?
Thanks Cindy,
It is Westminster New
But, as I said, it's only 4 files to clone, no big issue. As long as one is aware of this....
Re: Clone a Template [Support Thread]
Quote:
Originally Posted by
lat9
I've just submitted v1.1.0 to the plugins' area for review:
CHANGE: Update the cloned template's template_info file to include user-specified description.
The plugin's admin page now requires a template description; that text is used as the cloned template's "description" within its template_info.php file, allowing the template to be distinguished from its base in the Tools->Template Selection tool.
v1.1.0 is now available for download.
Re: Clone a Template [Support Thread]
Sorry but I am a little unclear on the procedure of cloning the template. After I clone my template, through admin, do I then select the cloned template as the master where I do my mods and re-clone that template after changes have been made or do I after cloning the original template, select the original template as the master and clone that one after after changes.
Thanks
Re: Clone a Template [Support Thread]
Quote:
Originally Posted by
allmart
Sorry but I am a little unclear on the procedure of cloning the template. After I clone my template, through admin, do I then select the cloned template as the master where I do my mods and re-clone that template after changes have been made or do I after cloning the original template, select the original template as the master and clone that one after after changes.
Thanks
When you Clone a Template, you're making a copy of the current contents of the files associated with that template as well as the template's layout-boxes settings. For example, if you've been making modifications to the responsive_classic template's file-set then cloning responsive_classic will pick up all the changes you've made to date into your newly-cloned template folders.
Once you've made a clone (i.e. copy) of that template, you'll go to Tools->Template Selection and select that newly-cloned template as your active template and then go to Tools->Layout Boxes Controller and click that big RESET button at the bottom of the screen to make sure that the layout-boxes are properly set.
For example, if you are cloning the responsive_classic template and entered allmart_rc as your Target Template then the cloning process copies all files from the /responsive_classic folders to their respective /allmart_rc ones. You'll make all further edits to the files in the /allmart_rc folders ... and you'll have "protected" your changes from inadvertent template-file overwrites on the next Zen Cart upgrade!