Copied to clipboard

Flag this post as spam?

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


  • Michael Scott 5 posts 25 karma points
    Nov 23, 2010 @ 17:50
    Michael Scott
    0

    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:

    <?UMBRACO_MACRO
    formguid="e5d6ff23-9332-4609-9d1d-e546caf314aa"
    macroAlias="umbracoContour.RenderForm" />
    I'm not sure what is setup incorrectly.
    Thanks for the help,
    Michael Scott
  • Michael Scott 5 posts 25 karma points
    Nov 23, 2010 @ 19:19
    Michael Scott
    0

    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

    Nov 24, 2010 @ 08:33

    How are you outputting the rte field, from xslt or with a umbraco:field tag on your template?

  • Michael Scott 5 posts 25 karma points
    Nov 24, 2010 @ 08:40
    Michael Scott
    0

    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

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 21:02
    Carlos
    0

    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 

    <?UMBRACO_MACRO
    formguid="e5d6ff23-9332-4609-9d1d-e546caf314aa"
    macroAlias="umbracoContour.RenderForm" />
    Will that work?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 30, 2010 @ 21:11
    Jan Skovgaard
    0

    Hi Carlos

    How are you rendering it with XSLT?

    Have you tried rendering the content using umbraco.library:RenderMacroContent or umbraco.library:GetItem ?

    /Jan

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 21:23
    Carlos
    0

    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>&nbsp;</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??

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 21:28
    Carlos
    0

    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.

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 21:32
    Carlos
    0

    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.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 30, 2010 @ 21:34
    Jan Skovgaard
    0

    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

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 21:36
    Carlos
    0

    Mmm, tried that and I got an "Error parsing XSLT file: \xslt\ScienceAccordian.xslt"

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 30, 2010 @ 21:38
    Jan Skovgaard
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 30, 2010 @ 21:39
    Jan Skovgaard
    0

    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

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 21:43
  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 30, 2010 @ 21:45
    Kim Andersen
    1

    It would be www.domain.com/pagename.aspx?umbdebugshowtrace=true

    I think Jan made a small typo writing umbraco instead of umb ;)

    /Kim A

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 30, 2010 @ 21:46
    Jan Skovgaard
    0

    Woops...yes, that indeed is a typo - sorry 'bout that.

    You should get a stack trace returned now. Thanks Kim :-)

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 21:49
  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 30, 2010 @ 21:53
    Kim Andersen
    0

    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:

    <xsl:value-of select="umbraco.library:Item($currentPage/@id,'itemDescription')" />
    <xsl:value-of select="umbraco.library:RenderMacroContent('itemDescription',$currentPage/@id)" disable-output-escaping="yes" />

    /Kim A

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 21:59
    Carlos
    0

    @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. 

  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 30, 2010 @ 22:01
    Kim Andersen
    0

    Oops, my bad Carlos, it should have been:

     <xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/itemDescription,$currentPage/@id)" disable-output-escaping="yes" />

    /Kim A

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 22:08
    Carlos
    0

    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

  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 30, 2010 @ 22:10
    Kim Andersen
    0

    I made a typo in my last post Carlos, could you try this code:

    <xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/itemDescription,$currentPage/@id)" disable-output-escaping="yes" />

    /Kim A

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 22:15
    Carlos
    0

    That didn't work. That just took out them content. 

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 22:19
    Carlos
    0

    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.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 30, 2010 @ 22:20
    Jan Skovgaard
    0

    @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(&lt;?UMBRACO_MACRO formguid="e5d6ff23-9332-4609-9d1d-e546caf314aa" macroAlias="umbracoContour.RenderForm" /&gt;,$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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 30, 2010 @ 22:30
    Jan Skovgaard
    0

    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('&lt;?UMBRACO_MACRO formguid="e5d6ff23-9332-4609-9d1d-e546caf314aa" macroAlias="umbracoContour.RenderForm" /&gt;',$currentPage/@id)" disable-output-escaping="yes" />

    /Jan

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 22:35
    Carlos
    0

    @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)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 30, 2010 @ 22:40
    Jan Skovgaard
    0

    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

  • Carlos 338 posts 472 karma points
    Dec 30, 2010 @ 22:43
    Carlos
    0

    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

  • Carlos 338 posts 472 karma points
    Jan 06, 2011 @ 23:28
    Carlos
    0

    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="&lt;umbraco:Item field=&quot;chooseContactForm&quot; runat=&quot;server&quot;&gt;&lt/umbraco:Item&gt;
    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.

  • usman 24 posts 43 karma points
    Jan 17, 2011 @ 10:52
    usman
    0

    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

  • Carlos 338 posts 472 karma points
    Jan 18, 2011 @ 19:13
    Carlos
    0

    @usman.

    Have you tried wrapping your in a form tag in your template.

    Example:  

    <form runat="server" id="areaWhereFormWillBe">
       <umbraco:Item runat="server" alias="bodyText" />

    </form> 

    This should make your form show up from your text box in the editor.  

    The only thing is that your content box can not be pulling the form from XSLT and you can not have your content box pulling content from an XSLT macro. 

    The text box has to be inside of your actual template directly not in pulling from an XSLT Macro.

  • usman 24 posts 43 karma points
    Feb 03, 2011 @ 10:53
    usman
    0

    @Carlos

    Thanks, Problem resolved

Please Sign in or register to post replies

Write your reply to:

Draft