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
A quick question: Is it possible to use the current node id with a custom datasource, so I can filter the datasource by the node id that I'm editing?
/ulrich
Hi Ulrich,
It's possible, by checking the querystring. Here's an example from how I do it with the Umbraco Content data-source...
https://github.com/leekelleher/umbraco-contentment/blob/1.2.1/src/Umbraco.Community.Contentment/DataEditors/DataList/DataSources/UmbracoContentDataListSource.cs#L62-L72
...although, it's not fool-proof, as it doesn't work within Nested Content. I've no idea about other embedded/repeatable element editors, e.g. BlockList, or Grid/DTGE. It's all about if the contextual node ID is passed in the querystring.
Good luck!
Cheers, - Lee
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Context ID
A quick question: Is it possible to use the current node id with a custom datasource, so I can filter the datasource by the node id that I'm editing?
/ulrich
Hi Ulrich,
It's possible, by checking the querystring. Here's an example from how I do it with the Umbraco Content data-source...
https://github.com/leekelleher/umbraco-contentment/blob/1.2.1/src/Umbraco.Community.Contentment/DataEditors/DataList/DataSources/UmbracoContentDataListSource.cs#L62-L72
...although, it's not fool-proof, as it doesn't work within Nested Content. I've no idea about other embedded/repeatable element editors, e.g. BlockList, or Grid/DTGE. It's all about if the contextual node ID is passed in the querystring.
Good luck!
Cheers,
- Lee
is working on a reply...