1

I've got a super content-type that contains at least 4 node references.

The first three references aren't always the same node-type but they contain just one referece.

The third reference can contain multiple references which are all of the same type but the type of these references my differ from time to time.

The forth reference references only one node each, which hast always the same type.

So I have a super node which references a few other nodes where number and node-type are not always the same. That's my starting point.

Now I have to send the whole content e.g. the custom fields I've created in the content-types of the sub-nodes via e-mail every time new content is created. The email should be plain text and should contain key/value pairs of the custom fields. The format is "key: value". This is fix my customer requires it and I can't change this at the moment.

To do this I want to use rules + views + rules_views (Rules Views Integration) and this is the point where I'm unsure what is the best way to continue. I pass the node-id from rules to views to render the just created node. If I tell views to use "row style: node" and choose "full node" as "display", I got my super node with all the sub nodes inside fieldsets.

Basically thats very close to what I want and it looks like I just have to theme my node to get rid of all the HTML an plain text but how?

Do I have to use my standard node-'node-type'-tpl.php files or can I add tpl.php-files just for this specific view? Or is it possible to add a different display besides 'teaser', 'full node' and 'rss' that views will recognize and that I can theme to my liking? And if one of these is the way to go, how can I pass arguments from views to my tpl.php-file to decide how to lay out my node (for display on the site or for the email via rules)?

I hope this all makes enough sense and you can help me out.

Thx in advance.

mantuko

  • I got a bit further. With the help of display-suite and node-displays it is possible to create new build modes and write custom tpl.php-files for them. Whether this solves everything I'm not sure but it's a good start. – mantuko Oct 25 '11 at 13:20
0

Finally I got that one too :)

One can add build modes with the Build modes module an decide on $node->build_mode what to render.

In the node-"super node".tpl.php one gets the node-ids of the referenced nodes from $node. Then one can node_load() these nodes into a variable and theme them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.