When I enable the Node Displays module, the node-type.tpl.php templates stop rendering in the right way.
Looking at the code, I see that the module is adding nd templates and node.tpl.php even when I'm not using the ND for this content type, so my node is rendered with node.tpl.php instead of node.tpl.php.

// Add nd-content_type-build_mode(-nid) template suggestion.
$vars['template_files'][] = 'nd';
$vars['template_files'][] = 'nd-'. $node->type;
$vars['template_files'][] = 'nd-'. $node->type .'-'. $node->build_mode;
$vars['template_files'][] = 'nd-'. $node->type .'-'. $node->build_mode .'-'. $node->nid;

// Break all the rendering if needed.
if (!$node->render_by_ds) {
    $vars['template_files'][] = 'node';
    return;
}

This seems to be a bug in the module, am I missing something?

CommentFileSizeAuthor
#2 743872.patch1.05 KBswentel

Comments

superstar’s picture

Yes, I have the same issue. When nd is enabled, the tpl files no longer effect the node display even those node types are excluded from nd.

This means that its nd or the standard template system (all or nothing).

swentel’s picture

Status: Active » Needs review
StatusFileSize
new1.05 KB

Yep, my fault completely apparently in the logic. Patch attached fixes the logic - can you verify to see if it works ?

Status: Needs review » Needs work

The last submitted patch, 743872.patch, failed testing.

swentel’s picture

Version: 6.x-2.0 » 7.x-1.x-dev
Status: Needs work » Patch (to be ported)

Weird error from simpletest, local tests are working fine - marking as to be ported after some more extensive testing on local sites too.

swentel’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.