0

I'm working on embedding content in rich editor, but not sure where to start. Iv'e got a bunch of nodes that contains data that i want embedded in other nodes.

Now what i want, is to make a macro, where i can choose one of these nodes, and insert some of the data from them, in the rich editor. For starters it could just be via node ID.

Or maybe just rendering a usercontrol with the macro? if that i possible?

I really haven't worked so much with macro's in umbraco, so i'm kinda lost, is this easily achieved?

Any pointers, or maybe a simple example?


UPDATE:

Just to clearify what im trying... I've got a bunch of nodes, lets call them "EmbeddedContent" Then on my Content Pages, i want to be able to add a macro, that will pull hardcoded data from a selected EmbeddedContent node.

So the only thing the user inputs, is which node to include.

And if possible, i would have it to be dynamic.. so if the EmbeddedContent is changed, i would change in pages where its included aswell.

Christian Bekker
  • 1,857
  • 4
  • 27
  • 43

1 Answers1

0

You can easily drop macros into a RTE in Umbraco, however dropping the macro into a RTE and then allowing the author to edit the macro so that it displays specific data sounds far too complex, especially for the author.

I would set up a collection of macros that display predefined data. The author can then select the macro that best suits the requirement.

However, it may be best to coe at this from a different direction and simplify it if possible. I often allow users to create nodes that are segments of markup and not whole pages, e.g. a banner comprising of an image and a link. You can then use a multi-node picker in a page to select any of these segments to build up the page's content.

You could have a multi-node picker field on the page, that allows the author to build up their content this way. You would just need to loop through the IDs in the multi-node picker and output the data from each node associated with each ID.

Going one step further, it is feasible that you could have the same multi-node picker field and instead of outputting the nodes directly to the template, you could allow a macro to be added to the RTE and this macro would output the nodes instead. Depending on the macro used, the data outputted could differ. I haven't used this technique personally as it is a little contrived but entirely possible.

Digbyswift
  • 10,310
  • 4
  • 38
  • 66