Drupal custom templates improvements

me321
94 Posts
me321 posted this 25 September 2015

In the latest update support was added for custom templates in Drupal. That's an amazingly powerful feature and it's gotten me all exited :)

I think however that a few improvements are needed.

  1. The templates like "post" make very little sense. Ususally Drupal ships with "basic page" and "article" content types (entity bundles). I think it would make more sense if the Themler template names correspond with those.
  2. When creating custom templates, you have to assign them to a URL. That too, makes little sense. It's a good feature to have, but basically a template should be attached to a content type (entity bundle). In Drupal it's very common to have your specific content types for each site, and they would pretty much always require a uniform layout. So if you have a content type called "fruit" it would make sense to be able to create a custom template in Themler, and assign it to all content of the type "fruit", not a URL.
  3. Currently it's only possible to configure how the templates are used if the theme is exported to include the themler module. That isn't desirable, for production sites one would not want the Themler module to be installed.

Furthermore, the problem with working with a URL is that if even if you specify a url logic so that all fruit content has http://.../fruit/[some-title], and configure the template to be show on fruit/*, it would only work on that clean URL but not on it's native url, node/xxx.

In the latest update support was added for custom templates in Drupal. That's an amazingly powerful feature and it's gotten me all exited :) I think however that a few improvements are needed. 1. The templates like "post" make very little sense. Ususally Drupal ships with "basic page" and "article" content types (entity bundles). I think it would make more sense if the Themler template names correspond with those. 2. When creating custom templates, you have to assign them to a URL. That too, makes little sense. It's a good feature to have, but basically a template should be attached to a content type (entity bundle). In Drupal it's very common to have your specific content types for each site, and they would pretty much always require a uniform layout. So if you have a content type called "fruit" it would make sense to be able to create a custom template in Themler, and assign it to all content of the type "fruit", not a URL. 3. Currently it's only possible to configure how the templates are used if the theme is exported to include the themler module. That isn't desirable, for production sites one would not want the Themler module to be installed. Furthermore, the problem with working with a URL is that if even if you specify a url logic so that all fruit content has http://.../fruit/[some-title], and configure the template to be show on fruit/*, it would only work on that clean URL but not on it's native url, node/xxx.
Vote to pay developers attention to this features or issue.
33 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 21 April 2016

Hi,

All templates have different structure. unfortunately you cannot use one template for all pages.
But we are considering the possibility of implementing this functionality in the future.

Themler theme supports shared areas with orange border- Sidebars. These areas were created to share controls between templates.
Simply add all controls inside Sidebars and enable these Sidebars on all templates.
To keep the same style of the article area simply style one of the Posts controls and set this style as default:

posts-set-as-default.png

For customised posts controls on other templates please use "reset to Default" option. This option will reset Posts style to default (see above):

posts-reset-to-default.png

Thank you,
Olivia

Hi, All templates have different structure. unfortunately you cannot use one template for all pages. But we are considering the possibility of implementing this functionality in the future. Themler theme supports shared areas with orange border- Sidebars. These areas were created to share controls between templates. Simply add all controls inside Sidebars and enable these Sidebars on all templates. To keep the same style of the article area simply style one of the Posts controls and set this style as default: !posts-set-as-default.png! For customised posts controls on other templates please use "reset to Default" option. This option will reset Posts style to default (see above): !posts-reset-to-default.png! Thank you, Olivia
webmetod
35 Posts
webmetod posted this 19 April 2016

Hello everyone.
Dear developers! Can you make so that you can delete all templates except the base? Or do only one base by default? If someone needed even add any number of additional.

I can not use a custom template to all pages? I am very tired to deal with this, a lot of time is spent on it. I turn back to Artisteer ...

enter image description here

Hello everyone. Dear developers! Can you make so that you can delete all templates except the base? Or do only one base by default? If someone needed even add any number of additional. I can not use a custom template to all pages? I am very tired to deal with this, a lot of time is spent on it. I turn back to Artisteer ... ![enter image description here][1] [1]: http://i77.fastpic.ru/big/2016/0419/6c/c82673bbad59bfcbb37976ffb4ce3c6c.jpg
Support Team
Support Team posted this 19 February 2016

Hi kpulman,

Here is the article about custom templates in Drupal:
http://answers.themler.com/articles/26302/how-to-use-custom-templates-in-drupal

It may be helpful.

Thank you,
Olivia

Hi kpulman, Here is the article about custom templates in Drupal: http://answers.themler.com/articles/26302/how-to-use-custom-templates-in-drupal It may be helpful. Thank you, Olivia
Kos
23 Posts
Kos posted this 15 February 2016

ok.. ignore me... I have sorted this, somehow... not really sure how, but works so far...

ok.. ignore me... I have sorted this, somehow... not really sure how, but works so far...
Kos
23 Posts
Kos posted this 15 February 2016

Hi,

Do I miss something??? with the latest Themler Update it's all changed, the User interface changed completely.

Can Support explain again how to created the Template for custom Content Types???

when I do the Websites with Themler, I have now different approach of the way I build the Web-sties with Drupal. As I only have to use content types Article, Basic Page and Blog, separating them with the Categories (Taxonomies) in Drupal, this way I'm sure that no other content types is in use that is not in the Themler.

BUT!

I have old websites I need to make a New Themes for.
There is content created with content type named WEBFORM ( webform module )
here is example of what happening at the moment.
all the website pages are ok ( www.myfamilyclinic.ie ) but When I open the page created with content type Webform ( http://www.myfamilyclinic.ie/en/node/19 ) it's opens without the standard header. and If you navigate to another page, or submit the form, you will get a good number of errors regarding template problem.
So, How do I make content type WEBFORM to use the Template called PAGE in Themler?
Ho do I make other Content Types themed in Themler? please explain properly....

Regards,
Kos

Hi, Do I miss something??? with the latest Themler Update it's all changed, the User interface changed completely. Can Support explain again how to created the Template for custom Content Types??? when I do the Websites with Themler, I have now different approach of the way I build the Web-sties with Drupal. As I only have to use content types Article, Basic Page and Blog, separating them with the Categories (Taxonomies) in Drupal, this way I'm sure that no other content types is in use that is not in the Themler. BUT! I have old websites I need to make a New Themes for. There is content created with content type named WEBFORM ( webform module ) here is example of what happening at the moment. all the website pages are ok ( www.myfamilyclinic.ie ) but When I open the page created with content type Webform ( http://www.myfamilyclinic.ie/en/node/19 ) it's opens without the standard header. and If you navigate to another page, or submit the form, you will get a good number of errors regarding template problem. So, How do I make content type WEBFORM to use the Template called PAGE in Themler? Ho do I make other Content Types themed in Themler? please explain properly.... Regards, Kos
Stagger Lee
1818 Posts
Stagger Lee posted this 10 January 2016

@me321, how do you list/display articles from custom content type without Views ?
I read it is not possible without custom coded module, only possible with Views.

And problem is Themler cannot touch single thing inside Views. Headings, bullet lists, links, no styling att all affect Views display.

**@me321**, how do you list/display articles from custom content type **without Views** ? I read it is not possible without custom coded module, only possible with Views. And problem is Themler cannot touch single thing inside Views. Headings, bullet lists, links, no styling att all affect Views display.
Stagger Lee
1818 Posts
Stagger Lee posted this 10 January 2016

If I use some of the Drupal core advised template names I get error "Invalid php-file name".

OK, some are Ok and "valid". Just scroll down and find one that works. Be carefull, not to use templates for blocks or views. Read Theme debug in source code (or F12) right.

If I use some of the Drupal core advised template names I get error "Invalid php-file name". OK, some are Ok and "valid". Just scroll down and find one that works. Be carefull, not to use templates for blocks or views. Read Theme debug in source code (or F12) right.
Stagger Lee
1818 Posts
Stagger Lee posted this 10 January 2016

Themler debug is only one line in settings.php. All beginners can do it, just put short info in Docs. I do understand Themler has no access to this file but it is very easy to activate.

$conf['theme_debug'] = TRUE;

Themler debug is only one line in settings.php. All beginners can do it, just put short info in Docs. I do understand Themler has no access to this file but it is very easy to activate. $conf['theme_debug'] = TRUE;
Stagger Lee
1818 Posts
Stagger Lee posted this 10 January 2016

I dont get all this logic for templates in Themler. Seems as they complicated it much and now try to reroute templates via non-standard Themler way.

I use Theme debug (core stuff) and no custom template named after Drupal core advices are recognized and respected.
All Themler developers need to do is give us option to name custom templates as Drupal advise. (we have it but Themler do something and they are not respected)
Theme debug shows what priority and what names are needed. it is all, no need for funny settings in Theme settings in backend,

https://www.drupal.org/node/223440

F12 in Chrome reveals what we need to do:

<!-- THEME DEBUG -->
<!-- CALL: theme('page') -->
<!-- FILE NAME SUGGESTIONS:
   * page--front.tpl.php
   * page--node.tpl.php
   x page.tpl.php
-->
<!-- BEGIN OUTPUT from 'modules/system/page.tpl.php' -->
…
<!-- END OUTPUT from 'modules/system/page.tpl.php' -->

Or other example:

<!-- THEME DEBUG -->
<!-- CALL: theme('html') -->
<!-- FILE NAME SUGGESTIONS:
   * html--node--add--forum--1120.tpl.php
   * html--node--add--forum--%.tpl.php
   * html--node--add--forum.tpl.php
   * html--node--add.tpl.php
   x html--node.tpl.php
   * html--default--2.tpl.php
   * html.tpl.php
-->
<!-- BEGIN OUTPUT from 'sites/all/themes/Web/templates/html/html--node.tpl.php' -->

I dont get all this logic for templates in Themler. Seems as they complicated it much and now try to reroute templates via non-standard Themler way. I use Theme debug (core stuff) and no custom template named after Drupal core advices are recognized and respected. All Themler developers need to do is give us option to name custom templates as Drupal advise. (we have it but Themler do something and they are not respected) Theme debug shows what priority and what names are needed. it is all, no need for funny settings in Theme settings in backend, https://www.drupal.org/node/223440 F12 in Chrome reveals what we need to do: <!-- THEME DEBUG --> <!-- CALL: theme('page') --> <!-- FILE NAME SUGGESTIONS: * page--front.tpl.php * page--node.tpl.php x page.tpl.php --> <!-- BEGIN OUTPUT from 'modules/system/page.tpl.php' --> … <!-- END OUTPUT from 'modules/system/page.tpl.php' --> Or other example: <!-- THEME DEBUG --> <!-- CALL: theme('html') --> <!-- FILE NAME SUGGESTIONS: * html--node--add--forum--1120.tpl.php * html--node--add--forum--%.tpl.php * html--node--add--forum.tpl.php * html--node--add.tpl.php x html--node.tpl.php * html--default--2.tpl.php * html.tpl.php --> <!-- BEGIN OUTPUT from 'sites/all/themes/Web/templates/html/html--node.tpl.php' -->
Stagger Lee
1818 Posts
Stagger Lee posted this 10 January 2016

Drupal Themler implementation is very neglected, compared to WordPress.

For forum I found how to style topic view, but not main index and forums view.

Drupal Themler implementation is very neglected, compared to WordPress. For forum I found how to style topic view, but not main index and forums view.
me321
94 Posts
me321 posted this 10 January 2016

No and the recent update promised to support custom drupal templates as well as core blog and forum templates. It all doesn't work. Ive submitted private issues including two themes but its being ignored for well over a week. I've asked several times for an update but no reply. I guess the drupal developer is MIA but I can't be sure, support is not responding at all.

No and the recent update promised to support custom drupal templates as well as core blog and forum templates. It all doesn't work. Ive submitted private issues including two themes but its being ignored for well over a week. I've asked several times for an update but no reply. I guess the drupal developer is MIA but I can't be sure, support is not responding at all.
Stagger Lee
1818 Posts
Stagger Lee posted this 10 January 2016

Correction: I just found out that specifying a wildcard (/*) doesn't work.

I think at this stage the custom template feature for Drupal isn't really usable yet, when it is it will be amazing. Hoping this can be announced soon.

Is this fixed ? Wildcard still doesnt work. Themler accept * as regular URL character.

> Correction: I just found out that specifying a wildcard (/*) doesn't work. > > I think at this stage the custom template feature for Drupal isn't really usable yet, when it is it will be amazing. Hoping this can be announced soon. Is this fixed ? Wildcard still doesnt work. Themler accept * as regular URL character.
Support Team
Support Team posted this 20 November 2015

looks like this is the same question as posted here:
http://answers.themler.com/questions/45002/can-t-override-contact-page-with-custom-template-anymore

looks like this is the same question as posted here: http://answers.themler.com/questions/45002/can-t-override-contact-page-with-custom-template-anymore
me321
94 Posts
me321 posted this 17 November 2015

I just noticed that I can create custom templates and name them
according to the url I want to use them on. That works brilliantly and
I don't have to use the Themler module either. That is really awesome!


Yes, we fixed this issue and uploaded a fix as hot-fix.

Can it be that this is now no longer working? Now when I create custom template with the same name as the URL it doesn't work anymore....

> I just noticed that I can create custom templates and name them > according to the url I want to use them on. That works brilliantly and > I don't have to use the Themler module either. That is really awesome! ---------- > Yes, we fixed this issue and uploaded a fix as hot-fix. Can it be that this is now no longer working? Now when I create custom template with the same name as the URL it doesn't work anymore....
me321
94 Posts
me321 posted this 01 November 2015

Great, looking forward to that major one. So far still congratulations on a really great product and very promising development work.

Great, looking forward to that major one. So far still congratulations on a really great product and very promising development work.
Support Team
Support Team posted this 30 October 2015

Hi,

I've noticed my themes being updated without release notes so I'm wondering if parts of this functionality is already implemented?

No, this feature is planned for MAJOR update. A few last updates were MINOR.

I just noticed that I can create custom templates and name them according to the url I want to use them on. That works brilliantly and I don't have to use the Themler module either. That is really awesome!

Yes, we fixed this issue and uploaded a fix as hot-fix.

Thank you,
Olivia

Hi, > I've noticed my themes being updated without release notes so I'm wondering if parts of this functionality is already implemented? No, this feature is planned for MAJOR update. A few last updates were MINOR. > I just noticed that I can create custom templates and name them according to the url I want to use them on. That works brilliantly and I don't have to use the Themler module either. That is really awesome! Yes, we fixed this issue and uploaded a fix as hot-fix. Thank you, Olivia

Last edited 01 November 2015 by Support Team

me321
94 Posts
me321 posted this 30 October 2015

Sorry for being absent from this thread for a while. It sounds like a great approach.
I've noticed my themes being updated without release notes so I'm wondering if parts of this functionality is already implemented?

I just noticed that I can create custom templates and name them according to the url I want to use them on. That works brilliantly and I don't have to use the Themler module either. That is really awesome!

I haven't tried this for entity bundles and taxonomy term pages (which is also a great idea) but will do soon.

Sorry for being absent from this thread for a while. It sounds like a great approach. I've noticed my themes being updated without release notes so I'm wondering if parts of this functionality is already implemented? I just noticed that I can create custom templates and name them according to the url I want to use them on. That works brilliantly and I don't have to use the Themler module either. That is really awesome! I haven't tried this for entity bundles and taxonomy term pages (which is also a great idea) but will do soon.
Support Team
Support Team posted this 29 October 2015

Hi,

For example you have "fruits" content type.
You create custom template with name page-node-fruits.tpl.php. This template will be used for all contents of the "fruits" content type.
These templates are alternative to Default template used for custom content types by default.

If you edit this tpl manually and then save theme it Themler the custom changes will be overridden. Just like with any theme file. This is a regular Themler template that can be edited in Themler (like Page, Post, Blog, etc).

Thank you,
Olivia

Hi, For example you have "fruits" content type. You create custom template with name `page-node-fruits.tpl.php`. This template will be used for all contents of the "fruits" content type. These templates are alternative to Default template used for custom content types by default. If you edit this tpl manually and then save theme it Themler the custom changes will be overridden. Just like with any theme file. This is a regular Themler template that can be edited in Themler (like Page, Post, Blog, etc). Thank you, Olivia
sonicthoughts
20 Posts
sonicthoughts posted this 28 October 2015

Hi guys,

I have some news.
We've added an option to specify the name of the template of "Custom Template" type in the same way as you can do in WP theme:

where my_content_type is a machine name of your custom content type. In the same way you can specify taxonomy term:
page-node-taxonomy-term-4.tpl.php

Currently this feature is on testing stage. It's planned for the next major Themler update.

If you have any further suggestions regarding this issue please let us know.

Thank you,
Olivia

so to be clear - themeler will generate a tpl file for the content type and we can edit as needed. one question - if we edit, will the changes in themler overwrite?

> Hi guys, > > I have some news. > We've added an option to specify the name of the template of "Custom Template" type in the same way as you can do in WP theme: > > ![](http://attachments.answers.billiondigital.com/747/6747/drupal-content-types.png) > > where `my_content_type` is a machine name of your custom content type. In the same way you can specify taxonomy term: > `page-node-taxonomy-term-4.tpl.php` > > Currently this feature is on testing stage. **It's planned for the next major Themler update.** > > If you have any further suggestions regarding this issue please let us know. > > Thank you, > Olivia so to be clear - themeler will generate a tpl file for the content type and we can edit as needed. one question - if we edit, will the changes in themler overwrite?
Support Team
Support Team posted this 19 October 2015

Hi,

All custom templates are located inside subfolder /templates because there too many files (for both Drupal 6 and Drupal 7 versions). We have not faced any issues with overrides. But let's wait for Themler update and "field trials" :-)

Thank you,
Olivia

Hi, All custom templates are located inside subfolder `/templates` because there too many files (for both Drupal 6 and Drupal 7 versions). We have not faced any issues with overrides. But let's wait for Themler update and "field trials" :-) Thank you, Olivia
You must log in or register to leave comments