Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
okay, so i am probably trying to use this in a way that it shoudln't be used... but here is what i am doing. I am trying to use this to put a poll in a grid. I have a docType poll question and i have nested PollAnswers on that docType...
PollAnswers has a property for votes... i would like to update that field, but would need to get the answer ID to do so... is this even possible? how would I identify the content then how coudl i update that property with content service?
excited to learn ;)
Unfortunately nested content can't have an ID value as they don't truly exist, so giving them a Node ID would potentially cause issues / conflicts.
My best suggestions would be to add a property on your answers for "key" or "id" and have this be entered by the content editor. You could then look this up within your loop.
In terms of saving data back to the property, this is probably going to be a bit tricky as again, the node doesn't truly exist. The only thing you could update is the raw NC value, but I wouldn't suggest that.
What I would probably look to do is use a custom DB table to record the votes. So if you do add a "key"/"id" field to your doc type, you could then create a table to record votes in (id + votecount) and then read the value from the database, rather than from the doc type property itself.
Really good question though bob, and has really made me think. I think ultimately, NC should basically be considered read only.
Hope this helps
It is really good question... which raises more questions! (That we don't have answers for yet) ;-)
If I was building this, I'd probably build the poll questions/answers as separate standalone nodes - then you can do the coding side of it however you would do previously. Then for the Grid, you could use a Content Picker (via DocTypeGridEditor) to select the poll (node).
That way you can still make the Grid item (cell) look nice/styled... and the logic/guts of the poll data is held elsewhere.
Main downside is extra nodes in your content tree.
yup, i quickly came to the same realizations...
but i do like the picker for the poll and am implmenenting that with DocTypeGridEditor for sure!
thanks for the quick feedback... these new packages ROCK!
Hi Lee, Matt, have you considered adding a read only property to DetachedPublishedContent so as to be able to identify the index of the NestedContent item ? that'd be really useful. Would it be also be wise / possible to set the Parent property to be the hosting IPublishedContent ?
A unique key on DetachedPublishedContent would be very helpful, perhaps a combination of the hosting IPublishedContent(s) + the index ?
Good points Hendy. Let's raise an issue on GitHub, we can explore further.
(I guess this applies to DocTypeGridEditor too?)
I've been thinking about this. It would be great if Nested Content created an Id for each item internally, and then came with a special "Nested Content Picker" data type to allow choosing of Nested Content items (i.e. in another NC item or in another node).
Some people may say "why don't you just create normal nodes?". Well, I do have to create normal nodes, but I don't want to, because:
Normal nodes feel a bit dirty and heavy to me when you don't attach a template and just intend them to model some data.
Normal nodes, even with list view, are much slower to manage when creating a complex content model. Many more page loads, forced to give the node a name, etc.
Nested Content is just a really neat way of giving your CMS users a complicated content structure that is not relevant to the node structure of your website and removes a huge amount of UI and slowness.
Note: I understand what I am asking for in having a "Nested Content Picker" is rather a lot of work and isn't neccessarily a common requirement.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted