List dropdown elements (datatypes) based on any pages that has it selected
Hello.
New with Umbraco, and new on the forum. I hope anyone can help.
I have created a custom datatype based on the Dropdown multiple. This dropdown contains work disciplines (HR, Accounting etc). This is so connected to different pages in the umbraco admin. Nothing special here i guess.
I am using the same dropdown in the frontend.
Is it possible to list only the values in the dropdown that HAS an connecting page.
So if i have;
Value 1
Value 2
Value 3
And only Value 1 and Value 3 has been selected on my pages. Then i just want to display Value 1 og Value 3 in my dropdown/list at the frontend.
I hope i made my self understandable :-) Thanks in advance.
You could probobly iterate all the Value:s but before you render the options in the dropdown, you could do a check if there is any nodes with the same dropdown value as the option.
var pages = uQuery.GetNodesByXPath("//*[string(workDisciplinId) = option.Id]");
Note: the about code is not tested, its just a concept.
List dropdown elements (datatypes) based on any pages that has it selected
Hello. New with Umbraco, and new on the forum. I hope anyone can help.
I have created a custom datatype based on the Dropdown multiple. This dropdown contains work disciplines (HR, Accounting etc). This is so connected to different pages in the umbraco admin. Nothing special here i guess.
I am using the same dropdown in the frontend. Is it possible to list only the values in the dropdown that HAS an connecting page.
So if i have; Value 1 Value 2 Value 3
And only Value 1 and Value 3 has been selected on my pages. Then i just want to display Value 1 og Value 3 in my dropdown/list at the frontend.
I hope i made my self understandable :-) Thanks in advance.
You could probobly iterate all the Value:s but before you render the options in the dropdown, you could do a check if there is any nodes with the same dropdown value as the option.
Note: the about code is not tested, its just a concept.
is working on a reply...