Download & Extend

Way to exclude tpl from list?

Project:Custom Node Template
Version:6.x-1.5
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hi, btw a great module!

Is there a way to excluse unwanted content types from the pull down list? I am looking for a way to give users the possibility to choose specific node type designs like design 1, design 2 or 3...

Comments

#1

Category:support request» feature request

Hi,

Thanks for the request. I want to double check I understand. You're asking for a way to control the node templates listed rather than having it default to all applicable templates within the theme? That functionality isn't in there right now, but that is interesting. I can see how it would be very useful. Let me think about how to best approach this.

- Matt

#2

Yes, thank you. It would be a nice way for users to choose a design template for content they have created.

Example: they created a node "my CV" and with "Custom Node Template " they have 3 different design options of how to present the cv...

#3

What do you feel would be the best interface for the admin to set up the selections? For example, would a list of available templates in the content type settings with checkboxes work? Or is there another interface that would work better, be simpler, be more intuitive, etc.?

#4

I don't know if its possible, but it would be nice to choose the template-file which will be available in the node create- or edit form. I added a screenshot of how I think it would be an easy and intuitive interface way to use...

First picture on top shows the admin area. The second below the node edit form (available also for users)

AttachmentSize
screenshot_1.png 54.91 KB

#5

Awesome. Very logical. I'll see what I can do to set time aside for this.

#6

Thats cool. Thanks a lot.

#7

There is also another option. If I create a content-only template related to that content type it should be listed only for that specific content type. Now it shows every template that is available in the theme. It lists every file name that start with 'node' and end with '.tpl.php'. When I creating a story why should I use a webform template.

#8

I can understand how this might seem counter-intuitive / not logical. But, a couple of things come to mind. If one is only or mainly looking for template options per content type, this module isn't really needed. The other is that this module provides options, so deciding that templates for certain content types shouldn't be presented seems arbitrary to me (vs. other criteria).

Regardless, when I have the bandwidth to implement the feature to allow choices in the templates presented, the option would be there to excluded certain templates that are intended only for one specific content type.

#9

Sorry I haven't been able to work on adding this (the original request). It's probably going to take me until mid-October to get to the point of being able to set aside time.

#10

I'm using a simple workaround with a small hack.

I just added:

<?php
       
if (!file_exists(drupal_get_path('module', 'custom_node_template')."/images/$name.png") && !file_exists("$theme_path/$name.png") ) continue;
?>

before line 179:
<?php
       
if (empty($displayname)) { $displayname = t('Main Node Template');}
?>

So only the templates with an icon are shown to the editor.