Copied to clipboard

Flag this post as spam?

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


  • Ed Parry 64 posts 249 karma points c-trib
    Jul 15, 2015 @ 10:15
    Ed Parry
    0

    Include custom macro in Newsletter Rich Text Editor

    Hi,

    I've built a custom macro to include in to the Newsletter Studio rich-text editor. The macro needs to show the results inline within the editor, but when I add the macro, I get the following error:

    Request error: The URL returned a 404 (not found): 
    /umbraco/backoffice/UmbracoApi/Macro/GetMacroResultAsHtmlForEditor
    

    Does anyone know what could be causing this? The macro is fine when included in the default Umbraco rich-text editor, so I would imagine the issue lies with the GetMacroResultsAsHtmlForEditor expecting a different editor?

  • Ed Parry 64 posts 249 karma points c-trib
    Jul 15, 2015 @ 14:08
    Ed Parry
    0

    Further to this, I've tried switching Newsletter Studio to use a new rich-text editor data type and I still get the same error. It seems to be an issue with Newsletter Studio not necessarily being aware of macro's when rendering the content?

  • Ed Parry 64 posts 249 karma points c-trib
    Jul 15, 2015 @ 14:16
    Ed Parry
    0

    ...me again!

    In case anyone else comes across this post with the same problem, I just discovered this response from Markus (developer of Newsletter Studio):

    Hi!

    Thank you for using the package!

    You can't use a macro inside a the content editor i Newsletter Studio as a macro needs to run in a "node aware" environment.

    If you would like to include dynamic content you have two options:

    Write a custom render task that replaces a placeholder in the newsletter with your dynamic content, see this link: http://support.newsletterstudio.org/customer/portal/articles/1052872-control-content-with-render-tasks Use the "Insert URL-content"-feature to fetch rendered HTML-content from ie. a page with the macro, see this: http://support.newsletterstudio.org/customer/portal/articles/1053016-creating-newsletters Another option might be to send the letter from the content section: http://support.newsletterstudio.org/customer/portal/articles/1053067-sending-from-the-content-section

    Cheers!

    // Markus

    So I'm going to try the routes mentioned in that post, but in the meantime - is there any movement on being able to use macro's here, or is it simply not an option?

  • Markus Johansson 1602 posts 4478 karma points
    Jul 15, 2015 @ 17:28
    Markus Johansson
    0

    Hi Ed!

    The reason is that a macro most of the time needs to be what I call "content aware". Since you can use stuff like "Model.CurrentNode" - what is the current node when you render a macro in a rich thext editor in the Newsletter Studio -section?

    One solution could be to say that the macros in Newsletter Studio always has the root node (id -1) as the current node but that feels a little bit "hacky" - another solution would be to include a content picker so that the user can choose the "current node" for the macro - also a little bit hacky.

    I would love to get your feedback on the other approaches - I'm willing to work togheter to figure out how it would be best to add a macro in the newsletter-section.

Please Sign in or register to post replies

Write your reply to:

Draft