Copied to clipboard

Flag this post as spam?

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


  • Carlos 338 posts 472 karma points
    Jan 06, 2011 @ 17:55
    Carlos
    0

    Add Contour Macro with Umbraco:Item for FormGuid

    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>

    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.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jan 07, 2011 @ 09:19
    Ismail Mayat
    2

    Carlos,

    I have done something similar and its all done by using macro syntax eg

      <umbraco:Macro ID="Macro1" FormGuid="[#formToRender]" Alias="umbracoContour.RenderForm" runat="server"></umbraco:Macro>

    just replace #formToRender with #chooseContactForm and it should be good to go.

    Regards

    Ismail

  • Carlos 338 posts 472 karma points
    Jan 07, 2011 @ 16:39
    Carlos
    0

    @Ismali,

    That was it. Thank you very much! I have been looking for a way to do that for 2 days. Always the simple fix.

    Again thanks.

  • Carlos 338 posts 472 karma points
    Jan 07, 2011 @ 16:41
    Carlos
    0

    Sorry spelled your name wrong, Ismail.

    Thanks again.

Please Sign in or register to post replies

Write your reply to:

Draft