Your code looks correct, currentNode.GetProperty<string>("autoContent") should return a csv list of selected IDs as stored by the AutoComplete datatype (should the property alias be "autoComplete" instead of "autoContent" ? just a wild guess).
// Render the output <ul> @foreach (Node nin myNodes) { <li><a href="@n.Url">@n.Name</a></li> } </ul> }
</umbraco:Macro>
If the values of the currentNode.GetProperty<string>("autoContent") are empty and the property exists, then best to check that the datatype is saving the values, in which case this SQL might be helpful:
/* property values for a given datatypeId and contentNodeId */
DECLARE @dataTypeId AS INT SET @dataTypeId = 1001
DECLARE @contentNodeId AS INT SET @contentNodeId = 1002
SELECT * FROM cmsPropertyType A LEFT OUTER JOIN cmsPropertyData B ON A.id = B.propertyTypeId WHERE A.dataTypeId = @dataTypeId AND B.contentNodeId = @contentNodeId
Hah, what a novel idea that I should render the output :) yep, that's cleared things up.... sorry, I'm a complete novice when it comes to uQuery/razor etc c# sort of things. it makes sense now.
using AutoComplete with inline razor/uQuery
Am trying to use AutoComplete and grab some data from it
currently trying to use some inline razor/uquery to achieve this
doesn't give me any output... tried currentNode.GetProperty<string>("autoContent"); but also empty... should I just use xslt instead?
Hi Tim,
Your code looks correct, currentNode.GetProperty<string>("autoContent") should return a csv list of selected IDs as stored by the AutoComplete datatype (should the property alias be "autoComplete" instead of "autoContent" ? just a wild guess).
Hendy
Hi Tim,
Hopefully this isn't a silly answer, but just added a loop to render the output.
If the values of the currentNode.GetProperty<string>("autoContent") are empty and the property exists, then best to check that the datatype is saving the values, in which case this SQL might be helpful:
HTH,
Hendy
Hah, what a novel idea that I should render the output :)
yep, that's cleared things up.... sorry, I'm a complete novice when it comes to uQuery/razor etc c# sort of things. it makes sense now.
is working on a reply...