|
|
Rank: Newbie
Joined: 4/21/2008 Posts: 12
|
How would one go about passing a ContentTree parameter into a .Net UserControl. I am trying to traverse the node tree. My goal is to create a survey-like page and store the user's selected answers in a table outside of the Umbraco tables. I need to traverse a node tree similar to the following. The following represents document types that I've created with their corresponding properties in parenthesis. Code:Question List (Columns) Question (Question, Required, Single / Multiple Answer) Answer (Answer, Text Allowed) Answer ... ... Question Answer ... Any help would be appreciated.
|
|
 Rank: Devotee
Joined: 10/20/2008 Posts: 83 Location: USA
|
So, are you simply trying to read the results of people adding nodes to your tree from a particular point forward? Are you using something like Doc2Form for people to submit answers to the survey? If so, you should be able to use the various utility methods available in the umbraco.cms library. Have a look at that namespace and you should find what you need I think. Thanks, Nik
Level 1 Certified / www.scandiaconsulting.com
|
|
 Rank: Umbracoholic
Joined: 9/27/2007 Posts: 1,123 Location: Belgium
|
Hi, I'm quite sure you're looking for this: http://forum.umbraco.org/yaf_postst6221_Umbarco-API-for-Nodes-in-C.aspxLook for cpalm's answer, he's using the Node class. In your case, you'll have to replace the Node.GetCurrent() part with something else to get to a specific node in the node tree (Node constructor has a bunch of ctor overloads, of which one takes a Int32) Hope this helps. Regards, /Dirk
level 1 & 2 certified - umbraco MVP 2008/2009 - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
|
|
Rank: Newbie
Joined: 4/21/2008 Posts: 12
|
Hi Dirk, That's exactly what I'm looking for. I was surprised how quickly and easily it was to implement.
Now my only dilemma is to have the Question property of the Question doc type to be a dropdown list that pulls from a database table. I need to do that same with the Answer property in the Answer doc type. Is there a data type out there that can accomplish this? I'll also need some way of adding questions and answers to the tables... not sure if there's anything out there that can do that either.
Ultimately I need to use three tables. 1) Questions (QuestionId, Question) 2) Answers (AnswerId, Answer) 3) Demographics (RegistrantId, QuestionId, AnswerId)
|
|
|
Guest |