I'm working on a site that uses node_embed for a number of content types and wants to use different templates for different layouts of the same content type. For example, if I have a photo content-type we want to be able to use a different a node-embed template depending on how many columns we are using in the current layout:

node-embed-1col--photo.tpl.php
node-embed-2col--photo.tpl.php
node-embed-3col--photo.tpl.php

An easy answer would be getting the standard template (node-embed--photo.tpl.php) to recognize which layout is currently being used and I'm currently trying to figure out how we could get that approach to work in our environment. As an alternative, could we also add an optional tpl variable to the embed:

[[nid:1000][tpl:2col]]

which would populate the template_files array (rough code here):

31: $vars['template_files'][] = 'node-embed-$tpl' . $vars['type'];

I'm happy to submit a patch for this method but wanted to see if there was any interest in this or if there was an easier way around this.

Comments

mcorbenster’s picture

I think this patch that i submitted may be similiar to what you are asking.
We had a need for a website to associate parameters to the embedded item and so added in a key:value pair as part of the embedded node format ie [[nid:xxxx key1:value1 key2:value2 ... ]] ).

The main patch is addressing the memory exhaust issue but also has the parameters.

http://drupal.org/node/862194#comment-3669324

mrharolda’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

As of 22 September 2014, we no longer support the Drupal 6 version of Node Embed due to the small install base (< 15%) and more importantly: general lack of time.

If you would like to help and maintain the 6.x branch until Drupal 8 is released, please apply for co-maintainership!