The goal is to place one ore more polls and/or slideshows anywhere within my blog post.

Step 1 is easy: With the Token Filter module, I can place tokens anywhere in my content.

Step 2 requires a module that creates a token which takes a nid as an argument and renders the node within my content, e.g. [render-node:1]. The rendered node would have a content type of poll and/or slideshow.

Is this a good way to go, or is there a better way? If this is the way to go, how would I go about creating a module to do this?

  • If all you know is really "Is this a good way to go" then this question is not particularly useful - it's a way that should work. If you want to know how, then don't expect us to write code for you. Questions that are substantially about code, where the code is not shown, are possibly closed.. Of course if it's so called XY problem, you may want to edit your question. If you want functionality X, and you think Y is the way, so you ask how to do Y instead of how to achieve X, you may leave yourself blind for some better options. – Mołot Dec 30 '13 at 20:48

Even though Mołot made a point about your question, I will give you an answer:

Using dynamic tokens with parameters is possible, but some coding is necessary. See pass parameters with tokens for more info.

You can also achieve what you need with some contrib modules, more specifically Field Collection (https://drupal.org/project/field_collection) and References (https://drupal.org/project/references). With these two, you can create a field collection for your content type which includes one field for text and one field for node reference. Field collection module makes it possible to have multiple values, so you could slice up the text and insert the node references in between. To render full nodes with node reference field, go to manage display and set it to Rendered node. You will end up with something like this (administration): Administration

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