Copied to clipboard

Flag this post as spam?

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


  • Jon Dunfee 199 posts 468 karma points
    Mar 14, 2010 @ 18:51
    Jon Dunfee
    0

    Contour form added to richtext snippet in media gallery not publishing

    Ok, hopefully I can explain what I'm doing to see if there is a solution to what I'm encountering [or lack thereof]. I have a media type, named "Snippet", that contains only a richtext box, alias "snippetText", allowing users to create snippets of reusable content (think a newsletter signup column tout). Now, I have a media picker in my doc type to select one of these snippets that will be shared in the current page and potentially any children. Here's the magic portion of XSLT in my RightShared macro:

    <xsl:for-each select="$currentPage/ancestor-or-self::node [string(data [@alias='rightSnippet']) != ''][1]">
    <xsl:sort select="@level" order="descending"/>
    <xsl:value-of select="umbraco.library:GetMedia(data [@alias='rightSnippet'], 'false')/data [@alias='snippetText']" disable-output-escaping="yes"/>
    </xsl:for-each>
     

    Here's an example of a node grabbed from the macro:

      <data alias="snippetText">
    <p><img src="/media/3098/interestedinlearningmore.png" width="193" height="37" alt="Interested In Learning More"/></p>

    <p><img src="/media/3104/callus000-000-0000.png" width="193" height="18" alt="Call Us 000-000-0000"/></p>

    <p><img src="/media/3110/tollfree000-000-0000.png" width="193" height="19" alt="Toll-Free 000-000-0000"/></p>

    <?UMBRACO_MACRO
    formguid="65dc5f56-ce3d-4b8a-bf92-dd7f6abdc187"
    macroAlias="umbracoContour.RenderForm" />
    </data>
     

    All works beautifully except the Contour form doesn't render. I verified the form is valid by adding it as regular content to test it. Is this even possible to achieve using Contour 1.0.7 on Umbraco 4.0.3?

     

  • Jon Dunfee 199 posts 468 karma points
    Mar 15, 2010 @ 08:24
    Jon Dunfee
    0

    I tried a different approach and received some different results - unusual results might I add.  Instead of selecting and rendering a snippet, I opted for a Form picker on the homepage and the macro is called on all pages. Here's the macro magic: (it's not limited to just this portion of xslt, the rest is irrelevant)

    <xsl:if test="$rightContactForm != ''">
    <xsl:variable name="Macro"><![CDATA[<?UMBRACO_MACRO macroAlias="umbracoContour.RenderForm" formguid="]]><xsl:value-of select="$rightContactForm" /><![CDATA["></?UMBRACO_MACRO>]]></xsl:variable>
    <xsl:value-of select="umbraco.library:RenderMacroContent($Macro, number($currentPage/@id))" disable-output-escaping="yes"/>
    </xsl:if>
     

    $rightContactForm is the correct guid for the Contour form I'm attempting to render; however, when I execute the macro I do not receive the correct rendering of the form; rather a next and previous button are present.  Here's the source of the rendering:

     <div id='contour' class=''>
    <div class="contourNavigation">
    <input type="submit" name="RenderForm_9$b_prev" value="Previous" id="RenderForm_9_b_prev" class="contourButton contourPrev" /><input type="submit" name="RenderForm_9$b_next" value="Next" id="RenderForm_9_b_next" class="contourButton contourNext" />
    </div>
    </div>

    Since this contact form resides on many pages (right column), I want to select the form or snippet containing the form on the home page and every child that wants to display the form can do so with a flag.  I'm afraid I may have to resort to hard coding the form as a separate template for pages that want to use the contact form just to satisfy the requirement.

  • Comment author was deleted

    Mar 15, 2010 @ 08:28

    Hi Jon,

    A Contour form requires to be inside a form with runat="server" attribute.

     

  • Jon Dunfee 199 posts 468 karma points
    Mar 15, 2010 @ 08:32
    Jon Dunfee
    0

    Got it, day 1, I double checked just to make sure tho.

  • Comment author was deleted

    Mar 15, 2010 @ 08:52

    Hey Jon, I think the main problem is is that you are trying to output the Contour form (a .net usercontrol) from an xslt macro. This will not work.

  • Jon Dunfee 199 posts 468 karma points
    Mar 15, 2010 @ 17:21
    Jon Dunfee
    0

    I showed the output to another developer and he immediately stated that's the default output of a dotnet wizard control.  Odd.  Anyway, I believe you are correct and I've decided on a different strategy to achieve similar goal.

Please Sign in or register to post replies

Write your reply to:

Draft