creating dropdown datatype with values relative node..
Hi
Im going to create a new datatype using the usercontrol wrapper (I think) - I have seen on Umbraco.tv tutorial for this
Before I start up I like to know if im on the right track
my umbraco solution is a multi website solution. Backend contains websites for many schools.
nodestructure simplified like:
schoolA
home
course1
course2
School B
home
course1
course2
etc etc
in the "school" node, when created, an ID for the school is entered. When creating af new "course" user right now is entering an ID for the course.( this ID is the key for fetching data from a webservice).
but .. what I want to achive is, that instead of entering course ID in a texfield, user should instead have a drop down where values are courses available for the specific school. The courses available is selected with the school ID as key.
my problem is now, how can I in my usercontrol for the dropdown datatype get the ID for the school. I cannot just ask by a static nodeID, cause its relative to where the course node is created (fx if I create a course node for school B I would wnat the ID entered for School B)
Can somehow in my code for my datatype usercontrol fetch the school ID (for the school in which context the datatype is being used)?
If I understand correctly, I think you'll want to walk up the tree from the current document (assuming document API rather than nodes incase the course or school is unpublished) to the school to get it's property. How about:
creating dropdown datatype with values relative node..
Hi
Im going to create a new datatype using the usercontrol wrapper (I think) - I have seen on Umbraco.tv tutorial for this
Before I start up I like to know if im on the right track
my umbraco solution is a multi website solution. Backend contains websites for many schools.
nodestructure simplified like:
schoolA
home
course1
course2
School B
home
course1
course2
etc etc
in the "school" node, when created, an ID for the school is entered. When creating af new "course" user right now is entering an ID for the course.( this ID is the key for fetching data from a webservice).
but .. what I want to achive is, that instead of entering course ID in a texfield, user should instead have a drop down where values are courses available for the specific school. The courses available is selected with the school ID as key.
my problem is now, how can I in my usercontrol for the dropdown datatype get the ID for the school. I cannot just ask by a static nodeID, cause its relative to where the course node is created (fx if I create a course node for school B I would wnat the ID entered for School B)
Can somehow in my code for my datatype usercontrol fetch the school ID (for the school in which context the datatype is being used)?
Does it make sense at all what im asking? :-)
Hi Nicolai,
If I understand correctly, I think you'll want to walk up the tree from the current document (assuming document API rather than nodes incase the course or school is unpublished) to the school to get it's property. How about:
HTH,
Hendy
Hi Hendy
Thx for the reply, its appriciated.
- yes thats what I want to do. I was just afraid this wasnt possible to do in a wrapped datatype.
I will now try an implement an get back wiht info if I succeeded.
Best Regards
Nicolai
is working on a reply...