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.
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.
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 :)
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.
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.
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
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
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
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
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:
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
When I run the debug it won't even jump in to MvcRenderContourForm.cshtml.
Do you recognize if anyone had similar problems?
//Frida
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
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))
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
is working on a reply...