Interestingly, I removed the macro from the TinyMCE content area and instead create a special template (copy of the main content template) where I add the form macro. And it works.
So now I'm confused. Macros don't seem to be running when added to TinyMCE?
good point. im using an xslt to render the bodytext field. duh. no user control macros from xslt. so if i swap that field to be rendered in the template it will probably work?
not sure why that never occurred to me. thanks tim.
I am trying to render the Contour form in the XSLT form and RTE separate from one directly inputted in the template. I have wrapped the whole Macro in a form tag in the Template, but am getting that
The "itemDescription" is a Rich Text Editor and from the Content I am adding the Contour Form directly into the Rich Text Editor. In the template I am adding:
So I would think that it would render if the Contour Form is entered into the Rich Text Editor of "itemDescription" but I have a feeling that because it is a Macro inside of a Macro that the Contour form is not rendering correctly and just outputting <?UMBRACO_MACRO formguid="e5d6ff23-9332-4609-9d1d-e546caf314aa" macroAlias="umbracoContour.RenderForm" />
But when I try to add the Contour Form into a Rich Text Editor that is rendered in an XSLT file the Contour form does not render. Just outputs that <?UMBRACO_MACRO... /> stuff.
The thing with this is, is that our content editors need to input the forms into these pages and I can not just put the forms directly into the Templates or the XSLT files by themselves and render them. They need to input these form Macros into the RTE's.
Neither of those worked. First one outputted nothing. No content rendered or anything. The second one just ouputted the word "itemDescription".
I will keep plugging away at this. I have seen other issues with this too from other people. No real solution quite yet. I you have other solutions I will definitely take them into consideration.
That is very close. I have added the form in 2 places on the page so you can see it. One is rendering the form correctly, to the right. BUT this is the default Umbraco:Item directly inputted in the Template.
The one on the left is under ASK A CONSERVATOR accordion tab. This one is only rendering Previous and Next buttons. But this is where I want the form to render correctly.
Is there a way to just render the form with the formguid using XSLT? Maybe I can see if the item has a form true/false and render the form if a bool is true.
@Kim - Those two lines of code seem very identical to me?
@Carlos...I'm not sure but every post I have seen using the RenderMacroContent extension seems like they're putting the macro code inside as the first parameter...
So maybe you should try this out unless the code posted by Kim above solves it.
Seems like we're getting a bit tired and should head into bed...at least I think I should...I think I made a typo in the previous post forgetting to add ' ' around the macro tag...the correct code should be this...
Yeh I wish I could head to bed. I am probably on the opposite side of the world as you. 2:30pm here. Still at work. Either way, Your approach is what I am going to look further into. Maybe I can get it to render this way. I will try a combination of a few things. I can get the formguid ID from the form picker which I will use if the Editor choses that form. I will see if this works.
Thanks anyways. Get some rest. I will post any advances.
Your approach keeps erroring in the XSLT editor but will figure something out.
System.Xml.XmlException: 'e5d6ff23-93' is an unexpected token. Expecting white space. Line 94, position 11. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ThrowExpectingWhitespace(Int32 pos) at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Xsl.Xslt.XsltInput.ReadTextNodes() at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling() at System.Xml.Xsl.Xslt.XsltInput.MoveToFirstChild() at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.XslIf() at System.Xml.Xsl.Xslt.XsltLoader.XslChoose() at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet) at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet) at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet) at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.XslForEach() at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet) at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.LoadTemplate(NsDecl stylesheetNsList) at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet() at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument() at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
I can see you have posted in there as well so I hope that Sebastian notices as I think he'll probably be able to help you out. Unfortunately .NET and C# is not what I'm best at...
But maybe it's possible for you to use a macro container to do the trick? (If you're using Umbraco 4.5.x)
I really hope you get this solved so you can go home and have a well earned rest.
Yeh, I was hoping for the best and hoping that just MAYBE it would work.
No dice though. Although Kim's approach was very close. It actually rendered part of the form. Just not the fields. So this may be a small stepping stone.
I am posting this here because of last week I got some good responses. But I moved my form to my template but I need to get the Guid ID from the doctype. My question is below.
I asked this in the Contour area but not sure if that section gets hit that much.
But here goes.
Don't know if this has been asked yet.
I am putting a Contour form inside my template, no problem.
This gives me my FormGuid when I choose a Contour form in the editor. Just spits out my ID.
I then try to put the FormGuid inside the Contour Macro inside my template like so:
<form ID="GeneralContactForm" runat="server"> Should be a contact form <umbraco:Macro FormGuid="<umbraco:Item field="chooseContactForm" runat="server"></umbraco:Item> " Alias="umbracoContour.RenderForm" runat="server"></umbraco:Macro> </form>
Can you put an Umbraco:Item inside the FormGuid?????
I am assuming you can not put a runat="server" inside of another. But what is the alternative to get the Guid from the ChooseContactForm field for my editors. Since we can not put .Net inside XSLT, this is my alternative solution, but I get and error <div class='contourErrorMessage'>Form could not be loaded, form is either missing or damaged</div>
I am facing same type of problem. Contour form is not showing up in editor, but when I place it in any template it works fine. How we can make it work through editor?
Form not showing up; it's inside a <form runat="server"> tag.
Hello!
I'm using Umbraco 4.5.2 and purchased/installed Contour 1.1.3. It's running on ASP.NET 4.0 in IIS7(.5?)
I've created my first form with guid e5d6ff23-9332-4609-9d1d-e54caf314aa. It's showing up in the Contour area of Umbraco.
I then add the form to a content page (with a <form runat="server"> wrapped around it by my MasterPage), but the form doesn't show up.
When I check the "View Source" for that page in my web browser, I see the following:
Interestingly, I removed the macro from the TinyMCE content area and instead create a special template (copy of the main content template) where I add the form macro. And it works.
So now I'm confused. Macros don't seem to be running when added to TinyMCE?
Mike
Comment author was deleted
How are you outputting the rte field, from xslt or with a umbraco:field tag on your template?
good point. im using an xslt to render the bodytext field. duh. no user control macros from xslt. so if i swap that field to be rendered in the template it will probably work?
not sure why that never occurred to me. thanks tim.
mike
I am trying to render the Contour form in the XSLT form and RTE separate from one directly inputted in the template. I have wrapped the whole Macro in a form tag in the Template, but am getting that
Hi Carlos
How are you rendering it with XSLT?
Have you tried rendering the content using umbraco.library:RenderMacroContent or umbraco.library:GetItem ?
/Jan
I am actually rendering it in a Rich Text Editor.
Here is my XSLT snippet and the Macro or XSLT it is isn is called ScienceAccordian.
<div class="accordianItemDescription">
<xsl:choose>
<xsl:when test="itemDescription != ''">
<xsl:value-of select="itemDescription" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
The "itemDescription" is a Rich Text Editor and from the Content I am adding the Contour Form directly into the Rich Text Editor.
In the template I am adding:
<form ID="GeneralContactForm" runat="server">
<umbraco:Macro Alias="ScienceAccordian" runat="server"></umbraco:Macro>
</form>
So I would think that it would render if the Contour Form is entered into the Rich Text Editor of "itemDescription" but I have a feeling that because it is a Macro inside of a Macro that the Contour form is not rendering correctly and just outputting
<?UMBRACO_MACRO
formguid="e5d6ff23-9332-4609-9d1d-e546caf314aa"
macroAlias="umbracoContour.RenderForm" />
What do you think??
If I add the Contour Form into a Rich Text Editor in the template such as
<umbraco:Item field="bodyText" runat="server"></umbraco:Item>
But when I try to add the Contour Form into a Rich Text Editor that is rendered in an XSLT file
the Contour form does not render. Just outputs that <?UMBRACO_MACRO... /> stuff.
The thing with this is, is that our content editors need to input the forms into these pages and I can not just put the forms directly into the Templates or the XSLT files by themselves and render them. They need to input these form Macros into the RTE's.
Hi Carlos
what happens if you use the umbraco.library:RenderMacroContent extension?
Try this
<xsl:value-of select="umbraco.library:GetItem($currentPage/@id,itemDescription)" disable-output-escaping="yes"/>
Could this perhaps do the trick?
/Jan
Mmm, tried that and I got an "Error parsing XSLT file: \xslt\ScienceAccordian.xslt"
What do you get if you add the querystring ?umbracodebugshowtrace=true to the url?
Does it give a red error describing more detailed what went wrong?
/Jan
What do you get if you add the querystring ?umbracodebugshowtrace=true to the url?
Does it give a red error describing more detailed what went wrong?
/Jan
Like this
http://www.myurl.org/science-section/collections/conservation/?umbracodebugshowtrace=true
Or
http://www.myurl.org/science-section/collections/conservation.aspx?umbracodebugshowtrace=true
either way it did not show me the trace.
Hmmm.
It would be www.domain.com/pagename.aspx?umbdebugshowtrace=true
I think Jan made a small typo writing umbraco instead of umb ;)
/Kim A
Woops...yes, that indeed is a typo - sorry 'bout that.
You should get a stack trace returned now. Thanks Kim :-)
http://www.myurl.org/science-section/collections/conservation.aspx?umbdebugshowtrace=true
Just redirects me back to my page.
But as far as I can see, you should not use an extension called GetItem like this:
<xsl:value-of select="umbraco.library:GetItem($currentPage/@id,itemDescription)" disable-output-escaping="yes"/>
You should be able to either use the RenderMacroContent or the Item extension. One of the following two snippets should work I think:
/Kim A
@Kim
Neither of those worked. First one outputted nothing. No content rendered or anything.
The second one just ouputted the word "itemDescription".
I will keep plugging away at this. I have seen other issues with this too from other people. No real solution quite yet.
I you have other solutions I will definitely take them into consideration.
Oops, my bad Carlos, it should have been:
/Kim A
I should have caught that.
@Kim
That is very close. I have added the form in 2 places on the page so you can see it.
One is rendering the form correctly, to the right. BUT this is the default Umbraco:Item directly inputted in the Template.
The one on the left is under ASK A CONSERVATOR accordion tab. This one is only rendering Previous and Next buttons. But this is where I want the form to render correctly.
There is the URL
http://www.dmns.org/science-section/collections/conservation
I made a typo in my last post Carlos, could you try this code:
/Kim A
That didn't work. That just took out them content.
Is there a way to just render the form with the formguid using XSLT? Maybe I can see if the item has a form true/false and render the form if a bool is true.
@Kim - Those two lines of code seem very identical to me?
@Carlos...I'm not sure but every post I have seen using the RenderMacroContent extension seems like they're putting the macro code inside as the first parameter...
So maybe you should try this out unless the code posted by Kim above solves it.
<xsl:value-of select="umbraco.library:RenderMacroContent(<?UMBRACO_MACRO formguid="e5d6ff23-9332-4609-9d1d-e546caf314aa" macroAlias="umbracoContour.RenderForm" />,$currentPage/@id)" disable-output-escaping="yes" />
Please notice that I have escaped the <> signs so the XSLT parser won't choke.
Hope this helps.
/Jan
Hi again Carlos...
Seems like we're getting a bit tired and should head into bed...at least I think I should...I think I made a typo in the previous post forgetting to add ' ' around the macro tag...the correct code should be this...
<xsl:value-of select="umbraco.library:RenderMacroContent('<?UMBRACO_MACRO formguid="e5d6ff23-9332-4609-9d1d-e546caf314aa" macroAlias="umbracoContour.RenderForm" />',$currentPage/@id)" disable-output-escaping="yes" />
/Jan
@Jan,
Yeh I wish I could head to bed. I am probably on the opposite side of the world as you. 2:30pm here. Still at work. Either way, Your approach is what I am going to look further into. Maybe I can get it to render this way. I will try a combination of a few things. I can get the formguid ID from the form picker which I will use if the Editor choses that form. I will see if this works.
Thanks anyways. Get some rest. I will post any advances.
Your approach keeps erroring in the XSLT editor but will figure something out.
System.Xml.XmlException: 'e5d6ff23-93' is an unexpected token. Expecting white space. Line 94, position 11.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ThrowExpectingWhitespace(Int32 pos)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Xsl.Xslt.XsltInput.ReadTextNodes()
at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling()
at System.Xml.Xsl.Xslt.XsltInput.MoveToFirstChild()
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.XslIf()
at System.Xml.Xsl.Xslt.XsltLoader.XslChoose()
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet)
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet)
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet)
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.XslForEach()
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet)
at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
at System.Xml.Xsl.Xslt.XsltLoader.LoadTemplate(NsDecl stylesheetNsList)
at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet()
at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument()
at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
Hi Carlos
I just realized that it's probably because the macro is a user control...those cannot be rendered with XSLT unfortunately. I just had a look over at this post http://our.umbraco.org/forum/umbraco-pro/contour/7908-Adding-Contour-form-in-XSLT?p=1 where Tim G. says it can't be done using XSLT. That's my bad...should have known...
I can see you have posted in there as well so I hope that Sebastian notices as I think he'll probably be able to help you out. Unfortunately .NET and C# is not what I'm best at...
But maybe it's possible for you to use a macro container to do the trick? (If you're using Umbraco 4.5.x)
I really hope you get this solved so you can go home and have a well earned rest.
All the best.
/Jan
Yeh, I was hoping for the best and hoping that just MAYBE it would work.
No dice though. Although Kim's approach was very close. It actually rendered part of the form. Just not the fields. So this may be a small stepping stone.
Thanks
I am posting this here because of last week I got some good responses. But I moved my form to my template but I need to get the Guid ID from the doctype. My question is below.
I asked this in the Contour area but not sure if that section gets hit that much.
But here goes.
Don't know if this has been asked yet.
I am putting a Contour form inside my template, no problem.
I want the FormGuid to pull from my editors.
I have the FormGuid ID using
<umbraco:Item field="chooseContactForm" runat="server"></umbraco:Item>
This gives me my FormGuid when I choose a Contour form in the editor. Just spits out my ID.
I then try to put the FormGuid inside the Contour Macro inside my template like so:
<form ID="GeneralContactForm" runat="server">
Should be a contact form
<umbraco:Macro FormGuid="<umbraco:Item field="chooseContactForm" runat="server"></umbraco:Item>
" Alias="umbracoContour.RenderForm" runat="server"></umbraco:Macro>
</form>
Can you put an Umbraco:Item inside the FormGuid?????
I am assuming you can not put a runat="server" inside of another. But what is the alternative to get the Guid from the ChooseContactForm field for my editors. Since we can not put .Net inside XSLT, this is my alternative solution, but I get and error
<div class='contourErrorMessage'>Form could not be loaded, form is either missing or damaged</div>
All help is much appricated. Thanks.
Hi,
I am facing same type of problem. Contour form is not showing up in editor, but when I place it in any template it works fine. How we can make it work through editor?
Thanks,
Usman
@usman.
Have you tried wrapping your in a form tag in your template.
Example:
<form runat="server" id="areaWhereFormWillBe">
</form><umbraco:Item runat="server" alias="bodyText" />
@Carlos
Thanks, Problem resolved
is working on a reply...