Copied to clipboard

Flag this post as spam?

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


  • Frida K 5 posts 26 karma points
    Mar 19, 2015 @ 12:22
    Frida K
    0

    Form is not visible and get a comment around <!--?UMBRACO_MACRO

    Hi!

    I just installed Contour 3.0.25 (in Umbraco 6.2.5) and the problem is that the form is not visible on the page. I can see the forms code in the developer tool but it has a comment around.

    <!--?UMBRACO_MACRO formguid="23188469-1f4d-4778-b196-dec173d8a58f" macroAlias="umbracoContour.RazorRenderForm" /-->

    Does anyone recognize the issue and have a solution?

    Thanks in advance,

    Frida

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 19, 2015 @ 15:23
    Jan Skovgaard
    0

    Hi Frida and welcome to our :)

    If you're seeing the source in a rich text editor then the code you're seeing is correct. It's a macro code and all macros inserted into the RTE will look like this if you use the "HTML view" option. Unless you choose "Render content in editor" in the macro settings in the "Developer - > Macroes -> Contour macro" options.

    Does that make sense? Otherwise you should be able to see what the rendered form looks like when using the preview function or simply just visit the page where the form should be displayed to see what it's going to look like.

    I hope this makes sense.

    /Jan

  • Frida K 5 posts 26 karma points
    Mar 19, 2015 @ 16:25
    Frida K
    0

    It's when I look at the page in Chrome and open the developer tool it's like this:

     

    And I have the option "Render content in editor" on "Yes".

    //Frida

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 19, 2015 @ 17:05
    Jan Skovgaard
    0

    Hi Frida

    Ok - How do you render the content of the rich text editor? Seems like you need to set the disable-output-escaping="yes" attribute if you're using XSLT or use @Html.Raw() if you're using Razor.

    If not you'll just get the raw HTML from the editor and since I can see a <p> tag, which is not escaped I'm guessing that it's what's causing the issue. If you're in doubt about how to do this then please let me know :)

    /Jan

  • Frida K 5 posts 26 karma points
    Mar 20, 2015 @ 09:32
    Frida K
    0

     

     

     

     

     

    Thanks for trying to help me!

    I'm using Razor, and I also tried with usercontrol without success.

    How do you mean that I can use @Html.Raw()?

    This is how Razor looks like in the rich text editor:

     

    Razor macro:

     

    Usercontrol in editor:

    Usercontrol macro:

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 20, 2015 @ 09:46
    Jan Skovgaard
    0

    Hi Frida

    Yup, you have a macro, which you place in the Rict Text Editor - But how do you render the content of the rich text editor? I'm assuming you have some razor code in your template somewhere to do this for you.

    If you have something like @Model.Content.GetPropertyValue("richtexteditor) (just an example) then you should wrap it in @Html.Raw(Model.Content.GetPropertyValue("richtexteditor")) in order to have things rendered properly.

    Hope this makes sense.

    /Jan

  • Frida K 5 posts 26 karma points
    Mar 20, 2015 @ 14:06
    Frida K
    0

    When I run the debug it won't even jump in to MvcRenderContourForm.cshtml. 

    Do you recognize if anyone had similar problems?

    //Frida

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 20, 2015 @ 15:24
    Jan Skovgaard
    0

    Hi Frida

    Could you share the code you're using for rendering the content from the rich text editor field please? :)

    I have not seen anyone other have this kind of issue I think.

    /Jan

  • Frida K 5 posts 26 karma points
    Mar 23, 2015 @ 13:11
    Frida K
    1

    I got help from a colleague to solve the problem! :)

    The solution was to add umbraco.library.RenderMacroContent in the document types scriptfile like this example:

    @Html.Raw(umbraco.library.RenderMacroContent(Model.GetPropertyValue("PageContent"), Model.Id))

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 23, 2015 @ 13:14
    Jan Skovgaard
    0

    Hi Frida

    Good that you managed to figure it out - This is where I was trying to go but it's hard to explain where to put the code and why if there is doubts about where and why :)

    But happy to hear you got help form at colleague and thanks for sharing so others can benefit if they come across the same issue.

    For the sake of others who might come across the same issue you should mark you last post as the solution - Then others can jump straight to it.

    Happy coding!

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft