No Code Attached Yet
avatar brianteeman
brianteeman
2 Jan 2026

I needed to copy an override file in the template manager and realised that there was no copy file button only a rename.

I started to code this functionality but I saw that we already have this but I dont see where it is used

<?php if ($this->type != 'home') : ?>
<hr class="mb-4">
<form method="post" action="<?php echo Route::_('index.php?option=com_templates&task=template.copyFile&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" enctype="multipart/form-data" class="mb-4">
<div class="form-group">
<input type="hidden" class="address" name="address">
<input type="hidden" name="isMedia" value="0">
<label for="new_name">
<?php echo Text::_('COM_TEMPLATES_FILE_NEW_NAME_LABEL') ?>
</label>
<input class="form-control" type="text" id="new_name" name="new_name" required>
<?php echo HTMLHelper::_('form.token'); ?>
</div>
<button type="submit" class="btn btn-primary"><?php echo Text::_('COM_TEMPLATES_BUTTON_COPY_FILE'); ?></button>
</form>

avatar brianteeman brianteeman - open - 2 Jan 2026
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jan 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Jan 2026
avatar coolcat-creations
coolcat-creations - comment - 3 Jan 2026

It says in the code if not home. Not sure if a template transports the default (home) flag from the style to this view. I can't find an alternate admin Template to test it.

avatar brianteeman
brianteeman - comment - 3 Jan 2026

That's not what home means

} elseif (\in_array($ext, $imageTypes)) {
try {
$this->image = $model->getImage();
$this->type = 'image';
} catch (\RuntimeException) {
$app->enqueueMessage(Text::_('COM_TEMPLATES_GD_EXTENSION_NOT_AVAILABLE'));
$this->type = 'home';

avatar coolcat-creations
coolcat-creations - comment - 3 Jan 2026

You are right. The Copy is only visible when the modal is opened from something else than copy. But the modal does not exist in something else than home. Home seems to be the view when no file is opened.

avatar chmst
chmst - comment - 6 Jan 2026

Seems to be from J3 and not used any more.

avatar brianteeman
brianteeman - comment - 6 Jan 2026

I wonder what else is there in the template manager and not used?

Add a Comment

Login with GitHub to post a comment