Copied to clipboard

Flag this post as spam?

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


  • Pete 152 posts 176 karma points
    Jun 30, 2010 @ 17:34
    Pete
    0

    Branching/decision trees in Contour

    I've had a read through the developer pdf and a browse through Contour but I still have a question.

     

    Can Contour manage branching/decision trees out of the box/are there any plugins that will allow it to do so? 

    For example, say you want a user to answer a couple of preliminary questions and either show them the rest of the form or just a message depending on the answers. 

  • Harald Ulriksen 207 posts 249 karma points
    Jun 30, 2010 @ 17:47
    Harald Ulriksen
    0

    Currently this is not supported.

    You can solve this in at least 2 ways.

    One option is using 2 forms and an automatic redirect from form1 to form2 based on the answer. You will need to store a reference on the first/second form to the other. You will also have to make a custom viewer if you wish to somehow list the full contents.

    Another option is to make a custom ascx form (copy renderform.ascx), your own class which inherits from the normal renderform.cs and override the next button event. Based on this you can control the flow. The farm digital has a post which show how you can inherit from the default form and override the functionality. http://farmcode.org/post/2010/03/26/Regionalizing-validation-messages-and-regex-in-Umbraco-Contour.aspx

    The need for decision trees/custom flow was discussed with Per and Tim at #codegarden 10 so they should be aware of it.
    Hth,
    Harald.

  • Pete 152 posts 176 karma points
    Jun 30, 2010 @ 17:52
    Pete
    0

    Thanks Harald, that answers my initial questions.

     

    Has anyone implemented custom code for decision trees like Harald describes? I'd appreciate any pointers. 

    It should be noted that the client will need to be able to create these forms on the fly... not sure if that makes any difference to the above suggestions. 

     

    Cheers!

  • Harald Ulriksen 207 posts 249 karma points
    Jun 30, 2010 @ 18:07
    Harald Ulriksen
    0

    If the client need to be able to control this I think the latter option overriding the next/prev buttons is the only viable solution for now. You will also need to add some way to configure the flow, not sure if one can add custom nodes to the contour left side tree but that would

    I'm implementing part of this next week for another project.

    Cheers,
    Harald

Please Sign in or register to post replies

Write your reply to:

Draft