Copied to clipboard

Flag this post as spam?

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


  • Chris 10 posts 40 karma points
    Mar 29, 2012 @ 22:13
    Chris
    0

    Question. HTML Select: Dynamic Options Based on Umbraco Content?

    Hi -

    First post - I apologize if this is wrong section for this question...

    I am wondering if it is possible to create dynamic dropdowns (on the front-end...), whose options are populated based on the Umbraco content tree. For example, let's say I have a "Products" node, and under that, two child nodes: "Group1" and "Group2". And both of these Groups has multiple children: "Product1", "Product2", etc.

    I would like to create two HTML select dropdowns, "A" and "B". I (assume) I can populate the options of dropdown "A" with the Group names, using some inline Razor, similar to producing a dymamic menu. However, I'm unsure how to populate the options of dropdown "B" based on the selection made in dropdown "A". JS? And if so, how exactly?

    Any general guidance would be great.

    -Chris

     

     

  • Chris 10 posts 40 karma points
    Apr 06, 2012 @ 16:38
    Chris
    0

    After exploring further, I now realize that this question was less Umbraco related than I thought.

    Using the hide/show jquery/css technique described here...

    http://www.sophox.com/wordpress/?p=1028

    ...I can see how it would be easy to create all required select elements in my Umbraco template via either a macro or inline razor, and build in the conditional functionality directly in the jquery.  Makes sense - you load everything up front (just like a dynamic menu...) and then hide/show based on the selections in the dropdowns.

    I will be using this technique to build a dynamic product configurator that follows my Umbraco content structure.

    I hope this helps someone down the road...

Please Sign in or register to post replies

Write your reply to:

Draft