I need something that can parse the "<?UMBRACO_MACRO..." bits from a full text field.
Those RenderMacro...() functions all require you to know the alias or id or name of a specific macro. I have an RTE that has the "embed macro" button turned on, so I don't know what the user might insert.
I haven't used Macros in a while, but I think they should render themselves if you output the content of a rich text editor onto your view? So you shouldn't need to call any custom code to do so.
If you can share a snippet of your code that shows what you're attempting, and a screenshot of the output that might be useful to help diagnose the issue.
It seems that if you embed a macro through the RTE that is embedded in a grid (Insert Macro button on RTE) it doesn't parse the macro. So all my macros are useless. Even the simplest stock snippets never render. I can't believe it but it's what my eyes are seeing so I'm trying to break it down into smaller pieces.
I think I have narrowed it down to a missing "RenderMacroContent" code in
Views\Partials\Grid\Editors\rte.cshtml.
Ah - I believe it's because macros inserted inside rich text editors, which are themselves inserted inside grid areas aren't supported. It's one level of inception too deep for the rendering method to handle.
Instead, you can disable macros in the rich text editors, and let users add macros directly into grid areas as their own blocks. That way, the grid rendering engine can parse and render the macros directly.
If you want text to be above and below a macro, just add something like this:
rich text editor
macro
another rich text editor
Maybe give that a try and see if it is a workable solution?
I didn't understand your answer at first, but I think this is what you described in your solution. Correct?
Check out the screen shot below. I went in and configured my "columns" in my "grid editor" to allow "Macros" instead of just "Rich Text Editor" and "Head Line" as they were defaulted to. As a result, the human editor can now have an 1) RTE, followed by 2) a "macro" followed by 3) RTE/Macro/Whatever! #OutOfBox
Thanks Chris Evans for your help! Hope this helps someone else.
How to do "@umbraco.library.RenderMacroContent" in v8?
What is the umbraco v8.6.1 version of the following code?
There is documentation on that here:
https://our.umbraco.com/Documentation/Reference/Templating/Macros/
I think the relevant bits would be
or with parameters:
Is that what you're after?
Cheers,
Chris
I need something that can parse the "<?UMBRACO_MACRO..." bits from a full text field.
Those RenderMacro...() functions all require you to know the alias or id or name of a specific macro. I have an RTE that has the "embed macro" button turned on, so I don't know what the user might insert.
I haven't used Macros in a while, but I think they should render themselves if you output the content of a rich text editor onto your view? So you shouldn't need to call any custom code to do so.
If you can share a snippet of your code that shows what you're attempting, and a screenshot of the output that might be useful to help diagnose the issue.
Here is the full problem:
https://our.umbraco.com/forum/using-umbraco-and-getting-started/103978-umbraco-v861-macros-fail-in-rte-insert-even-simplest
It seems that if you embed a macro through the RTE that is embedded in a grid (Insert Macro button on RTE) it doesn't parse the macro. So all my macros are useless. Even the simplest stock snippets never render. I can't believe it but it's what my eyes are seeing so I'm trying to break it down into smaller pieces.
I think I have narrowed it down to a missing "RenderMacroContent" code in Views\Partials\Grid\Editors\rte.cshtml.
Ah - I believe it's because macros inserted inside rich text editors, which are themselves inserted inside grid areas aren't supported. It's one level of inception too deep for the rendering method to handle.
Instead, you can disable macros in the rich text editors, and let users add macros directly into grid areas as their own blocks. That way, the grid rendering engine can parse and render the macros directly.
If you want text to be above and below a macro, just add something like this:
Maybe give that a try and see if it is a workable solution?
I didn't understand your answer at first, but I think this is what you described in your solution. Correct?
Check out the screen shot below. I went in and configured my "columns" in my "grid editor" to allow "Macros" instead of just "Rich Text Editor" and "Head Line" as they were defaulted to. As a result, the human editor can now have an 1) RTE, followed by 2) a "macro" followed by 3) RTE/Macro/Whatever! #OutOfBox
Thanks Chris Evans for your help! Hope this helps someone else.
That’s exactly it! Glad it was helpful for you. High five!
is working on a reply...