Hallo
I am aware of

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

but isn't there a wa to target a specific node ID ? Something like

ds-1col--node--5.tpl.php

tx
Simone

Comments

cimo75’s picture

Title: Per node tempalte suggestion » Per node template suggestion
aspilicious’s picture

I'll look at the way we generate the "theme hook suggestions" to see if it is possible to do this.
There is a possibility DS can't do that because we use a kinda special way to alter the templates.

To be continued.

aspilicious’s picture

Assigned: Unassigned » bceyssens
bceyssens’s picture

Status: Active » Needs review
StatusFileSize
new2.22 KB

In this patch I added a template suggestion for specific entities. Template name format: ds-1col--node--{id}.tpl.php
cimo75 can you validate if this patch is working for you?

aspilicious’s picture

Version: 7.x-2.10 » 8.x-2.x-dev
Status: Needs review » Patch (to be ported)

I tested this and it is working fine. Needs to be ported

aspilicious’s picture

So apperantly this wasn't pushed :D

aspilicious’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.93 KB

Lets see...

  • aspilicious committed 1d553a3 on 8.x-2.x
    Issue #2503653 by aspilicious, bceyssens: Per node template suggestion
    
aspilicious’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

swentel’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Needs work
StatusFileSize
new6.81 KB

This broke rendering of fieldable panel panes. It breaks on entity_extract_ids because it can't find the object (some entity types not putting the object in the root, but instead in '#elements').

Moving to critical as it can break existing installations heavily.

I've renamed $object to $entity_type for more clarity - you'll see the check on $vars[entity] further down in the patch, so I think I hit this already with fieldable panel panes once in the past :)

(maybe, we could simplify this function heavily in that case but declaring/re-using $bundle, $entity_type and $entity then, but that's maybe for a follow up)

swentel’s picture

Status: Needs work » Needs review
swentel’s picture

Version: 8.x-2.x-dev » 7.x-2.x-dev

Moving to D7

swentel’s picture

StatusFileSize
new6.8 KB

damn it, wrong patch, #elements was wrong

aspilicious’s picture

Swentel please commit this and create a release if it is that bad.

The last submitted patch, 4: per_node_template_suggestions-2503653-4.patch, failed testing.

The last submitted patch, 4: per_node_template_suggestions-2503653-4.patch, failed testing.

The last submitted patch, 4: per_node_template_suggestions-2503653-4.patch, failed testing.

The last submitted patch, 12: 2503653-12.patch, failed testing.

The last submitted patch, 12: 2503653-12.patch, failed testing.

The last submitted patch, 12: 2503653-12.patch, failed testing.

  • swentel committed 74b0a97 on 7.x-2.x
    Follow up for #2503653: breaks with entity types which puts the object...
swentel’s picture

Status: Needs review » Fixed

committed and pushed - will wait a bit for release. In case you see reports where there's a fatal on entity_extract_ids - just tell them to use dev :)

  • swentel committed 2ccb1dd on 7.x-2.x
    Follow up for #2503653: add tests.
    
swentel’s picture

FWIW, I've added basic tests for the hook suggestions after this patch because of the $object => $entity_type rename, I wanted to make sure I really didn't break anything - and we can maybe start testing out more stuff.

See http://cgit.drupalcode.org/ds/commit/?id=2ccb1dd

I'll try to figure out if we can port that to D8, it's kind of handy :)

swentel’s picture

Did forward port of this as well - feel free to revert the $object rename in case you don't like it (I find it much clearer, but those things can be discussed of course).

  • swentel committed 2f27109 on 8.x-2.x
    Follow up for #2503653: added tests for D8 branch too.
    

Status: Fixed » Closed (fixed)

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