Copied to clipboard

Flag this post as spam?

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


  • Nikolas van Etten 202 posts 162 karma points
    Mar 19, 2010 @ 00:12
    Nikolas van Etten
    0

    Add Contour form based on field value

    Any way to accomplish this? User will set true/false to a field value "displayContactForm". Easy (and dirty) way is to use css, but not a good alternative, although I'll go with that if there's no other options.

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Mar 19, 2010 @ 11:22
    Tim Geyssens
    1

    Sure nikolas,

    You could simply do this in your template.

    Check this example (it's in blog4umbraco, it hides the comment form if the field value "close comments" is true)

    http://blog4umbraco.codeplex.com/SourceControl/changeset/view/40819#685144

    These parts are important:

    <script runat="server">
    bool closeComments = false;

    void Page_Load(object sender, System.EventArgs ea) {
    try{
    if(umbraco.presentation.nodeFactory.Node.GetCurrent().GetProperty("closeComments").Value == "1")
    closeComments = true;
    }
    catch(System.NullReferenceException){}
    }
    </script>
    <% if (!closeComments) { %>

     

     

    <% } %>

     

     

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies