I have several macros that create things like subnavigation and JW player for videos for our client to use in a user friendly way. However, sometimes they insert them in the richtext editor for the page which I have allowed. Inserting is fine as is editing but without putting extra space in before inserting the macro, it is not possible to "escape" the yellow macro box to continue adding content below it. The cursor remains stuck in the macro box. Likewise, selecting the macro and backspace does not delete it, only the content. Then any content that follows is sucked into the macro's formatting. Is there anyways aside from manually deleting it from the html or adding a <p></p> after the macro in the html to "escape" the yellow macro box?
// Macro: RenderSubStructure.cshtml
@if (Model.Children.Where("Visible").Any())
{
@* For each child page under the root node, where the property umbracoNaviHide is not True *@
foreach (var childPage in Model.Children.Where("Visible"))
{
@Html.Raw(umbraco.library.RenderTemplate(childPage.Id, childPage.Template))
}
}
Inserting Macros in TinyMce3 Umbraco v.6.1.3
I have several macros that create things like subnavigation and JW player for videos for our client to use in a user friendly way. However, sometimes they insert them in the richtext editor for the page which I have allowed. Inserting is fine as is editing but without putting extra space in before inserting the macro, it is not possible to "escape" the yellow macro box to continue adding content below it. The cursor remains stuck in the macro box. Likewise, selecting the macro and backspace does not delete it, only the content. Then any content that follows is sucked into the macro's formatting. Is there anyways aside from manually deleting it from the html or adding a <p></p> after the macro in the html to "escape" the yellow macro box?
Sorry if that is confusing.
I'm having the exact same problem. A fix would be very welcome.
Anyone ever solve this?
I kind of did.
I ended up making sub document types, and then using macros to insert them dynamically.
Meaning you can't add stuff in the editor, but the user can add different kind of content dynamically on the same page.
Hi, Thanks for the reply,
You've done it basically the same way as I did :)
@if (tab.HasProperty("macroContent") && tab.GetProperty("macroContent").Value != String.Empty)
{
@Html.Raw(umbraco.library.RenderMacroContent(tab.GetPropertyValue("macroContent").ToString(), tab.Id))
}
I basically have some tabs generated via a partial, and each tab has a macrocontainer, which in turn can have a series of different macro's.
I think it turned out to be a more flexible and solid solution.
So while it doesn't "solve" the original question, it gives a great alternative.
is working on a reply...