Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ashley Andersen 45 posts 88 karma points
    Aug 15, 2013 @ 20:17
    Ashley Andersen
    0

    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.

  • André 4 posts 24 karma points
    Aug 30, 2013 @ 10:05
    André
    0

    I'm having the exact same problem. A fix would be very welcome.

  • Craig Richards 17 posts 75 karma points
    Apr 10, 2014 @ 01:05
    Craig Richards
    0

    Anyone ever solve this?

  • André 4 posts 24 karma points
    Apr 11, 2014 @ 10:48
    André
    0

    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.

    <div class="marketing">
        <umbraco:Macro Alias="RenderSubStructure" runat="server" />
    </div>
    

    // 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)) 
        }
    }
    
  • Craig Richards 17 posts 75 karma points
    Apr 11, 2014 @ 12:41
    Craig Richards
    0

    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. 

  • André 4 posts 24 karma points
    Apr 11, 2014 @ 12:56
    André
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft