Drupal - delete template not associated with any content

Stagger Lee
1818 Posts
Stagger Lee posted this 09 January 2016

If someone type just one character wrong in custom Drupal template name, later it is not possible to delete this template.
Because of this wrong character there is not content associated with this template and dropdown switch back to "Home" template.

I know I can do it manually but check this problem.

If someone type just one character wrong in custom Drupal template name, later it is not possible to delete this template. Because of this wrong character there is not content associated with this template and dropdown switch back to "Home" template. I know I can do it manually but check this problem.
Vote to pay developers attention to this features or issue.
6 Comments
Order By: Standard | Newest
Stagger Lee
1818 Posts
Stagger Lee posted this 09 January 2016

Second problem, copy/paste one row with menu inside, between templates, change menu from "Horizontal Menu 1" to "Horizontal Menu 4".

Second problem, copy/paste one row with menu inside, between templates, change menu from "Horizontal Menu 1" to "Horizontal Menu 4".
Support Team
Support Team posted this 21 January 2016

Hi,

Sorry for the delay.

If someone type just one character wrong in custom Drupal template name, later it is not possible to delete this template.
Because of this wrong character there is not content associated with this template and dropdown switch back to "Home" template.

In general, Custom Template always shows Home page content. To switch to this template you don't need to associate any content with it.

I've found only one problem when you name the file with duplicated "page" word.
Please let us know in which other cases you can't navigate to custom template.

Second problem, copy/paste one row with menu inside, between templates, change menu from "Horizontal Menu 1" to "Horizontal Menu 4".

Yes, you should either use Sidebars or Paste the Row with menu as link using "Paste Link" option.

Thank you,
Olivia

Hi, Sorry for the delay. > If someone type just one character wrong in custom Drupal template name, later it is not possible to delete this template. Because of this wrong character there is not content associated with this template and dropdown switch back to "Home" template. In general, **Custom Template** always shows Home page content. To switch to this template you don't need to associate any content with it. I've found only one problem when you name the file with duplicated "page" word. Please let us know in which other cases you can't navigate to custom template. > Second problem, copy/paste one row with menu inside, between templates, change menu from "Horizontal Menu 1" to "Horizontal Menu 4". Yes, you should either use Sidebars or Paste the Row with menu as link using "Paste Link" option. Thank you, Olivia
Support Team
Support Team posted this 25 January 2016

UPD:

I've found only one problem when you name the file with duplicated "page" word.

Our developers added validation to avoid this problem.

Thank you,
Olivia

UPD: > I've found only one problem when you name the file with duplicated "page" word. Our developers added validation to avoid this problem. Thank you, Olivia
Stagger Lee
1818 Posts
Stagger Lee posted this 25 January 2016

Olivia, I dont care what is normal for Drupal part to switch to, Home or not. Problem is when I chose one custom template it switch to Home and "Remove template" option is greyed, not active.

How to associate this template to content if it is to start with filename named not according to any Drupal core routing logic.

You have to account we Users will make mistakes when naming templates (enough with one character typed wrong) and give us option to delete them.

Olivia, I dont care what is normal for Drupal part to switch to, Home or not. Problem is when I chose one custom template it switch to Home and "Remove template" option is greyed, not active. How to associate this template to content if it is to start with filename named not according to any Drupal core routing logic. You have to account we Users will make mistakes when naming templates (enough with one character typed wrong) and give us option to delete them.
Stagger Lee
1818 Posts
Stagger Lee posted this 25 January 2016

Olivia, here is eaxample of 2 custom templates. Maybe it can help your developers for troubleshooting.
First one cannot be deleted/removed in Themler, second one can. Difference in code is, as it seems, first one is missing half of code inside second one. It is nothing I could influence manually, it is Themler making code.

<?php
if (!isset($templates)) $templates = array();
$templates['customTemplate'][] = array('id' => '2', 'ui_title'=> 'Custom Template', 'd6' => 'custom_2', 'd7' => 'custom__2', 'name' => 'referenzen', 'caption' => "Referenzen" );
?>
<?php
if (!isset($templates)) $templates = array();
$templates['customTemplate'][] = array('id' => '6', 'ui_title'=> 'Custom Template', 'd6' => 'custom_6', 'd7' => 'custom__6', 'name' => 'referenzen-content-type', 'caption' => "Referenzen Content Type" , 'custom_name_d6' => 'node_referenzen', 'custom_name_d7' => 'node__referenzen');
?>

Olivia, here is eaxample of 2 custom templates. Maybe it can help your developers for troubleshooting. First one cannot be deleted/removed in Themler, second one can. Difference in code is, as it seems, first one is missing half of code inside second one. It is nothing I could influence manually, it is Themler making code. &lt;?php if (!isset($templates)) $templates = array(); $templates['customTemplate'][] = array('id' =&gt; '2', 'ui_title'=&gt; 'Custom Template', 'd6' =&gt; 'custom_2', 'd7' =&gt; 'custom__2', 'name' =&gt; 'referenzen', 'caption' =&gt; "Referenzen" ); ?&gt; &lt;?php if (!isset($templates)) $templates = array(); $templates['customTemplate'][] = array('id' =&gt; '6', 'ui_title'=&gt; 'Custom Template', 'd6' =&gt; 'custom_6', 'd7' =&gt; 'custom__6', 'name' =&gt; 'referenzen-content-type', 'caption' =&gt; "Referenzen Content Type" , 'custom_name_d6' =&gt; 'node_referenzen', 'custom_name_d7' =&gt; 'node__referenzen'); ?&gt;
Support Team
Support Team posted this 27 January 2016

Hi,

In general, the main rules in creating Custom template are:

  1. the file name should be page-[...].tpl.php. Otherwise Drupal will not be able to see it(!). Everything in [] is not important (for Drupal). You will be able to open this template in Themler in any case. Even if there is no content assigned to it. By default Custom template shows the content of the home page. If you want to associate content type (even if content type itself does not exists) the filename should be: page-node-contenttypename.tpl.php
  2. the filename should not contain duplicated word "page".

That's all.

It's difficult to say why the first template wasn't generated properly.
Themler can't load it because it's broken.
You can remove it manually (from basic theme and theme_preview):

  1. remove appropriate template files from templates/page andtemplate/html folders.
  2. remove this template from templates/templates.php file.
  3. clear Drupal cache

Thank you,
Olivia

Hi, In general, the main rules in creating Custom template are: 1. the file name should be `page-[...].tpl.php`. Otherwise Drupal will not be able to see it(!). Everything in [] is not important (for Drupal). You will be able to open this template in Themler in any case. Even if there is no content assigned to it. By default Custom template shows the content of the home page. If you want to associate content type (even if content type itself does not exists) the filename should be: `page-node-contenttypename.tpl.php` 2. the filename should not contain duplicated word "page". That's all. It's difficult to say why the first template wasn't generated properly. Themler can't load it because it's broken. You can remove it manually (from basic theme and theme_preview): 1. remove appropriate template files from `templates/page` and` template/html` folders. 2. remove this template from `templates/templates.php` file. 3. clear Drupal cache Thank you, Olivia
You must log in or register to leave comments