I am building a site for a charity. The users of the site aren't very technical.
I want them to be able to add Dog Breeds to a list on a settings node I have created. I then want them to be able to choose from a drop down one of the dog breeds they have entered on a "dog" page.
Is this possible to do in Umbraco? Can a user add to a list in Umbraco and this populate a data type like a drop down on another page?
We do similar to your requirement- we built a property editor to display content stored in a multi textstring property on a config node. The editor allows users to make a selection from the dropdown and then store a string value against that selection.
I'd create a new property editor, with two prevalues - one for the id of the config node and one for the alias of the source property. In the editor controller, use contentResource.getById() to look up the node using the id, then get the list of breeds from the node. Once you've got the data, you can use it as the model for the dropdown in your new editor.
Super simple and dirty Angular to grab the breed list (eg should be breaking out of the loops once a match is found):
contentResource.getById(nodeId).then(function (resp) {
var breeds;
angular.forEach(resp.tabs, function (tab) {
angular.forEach(tab.properties, function (prop) {
if (prop.alias === 'dogBreeds') {
breeds = prop;
}
});
});
console.log(breeds.value);
});
There's decent documentation around building a property editor available here.
User created data type
Hello,
I am building a site for a charity. The users of the site aren't very technical.
I want them to be able to add Dog Breeds to a list on a settings node I have created. I then want them to be able to choose from a drop down one of the dog breeds they have entered on a "dog" page.
Is this possible to do in Umbraco? Can a user add to a list in Umbraco and this populate a data type like a drop down on another page?
Thanks and kind regards,
J
Hi James
We do similar to your requirement- we built a property editor to display content stored in a multi textstring property on a config node. The editor allows users to make a selection from the dropdown and then store a string value against that selection.
I'd create a new property editor, with two prevalues - one for the id of the config node and one for the alias of the source property. In the editor controller, use contentResource.getById() to look up the node using the id, then get the list of breeds from the node. Once you've got the data, you can use it as the model for the dropdown in your new editor.
Super simple and dirty Angular to grab the breed list (eg should be breaking out of the loops once a match is found):
There's decent documentation around building a property editor available here.
Hope that helps.
N
is working on a reply...