Closed woblet96 closed 7 months ago
@woblet96 Thanks for taking the time to report this. It's a known issue of using Data List within the Block List editor, it's not possible to get the current page ID. (The same issue applies with Nested Content and the Block Grid editor too).
@leekelleher Hi, thanks for the fast response. We don't actually need the current page Id. We want to use another property on the element as we want to use the 'Year' property (currently "season" in the code) to control the Data source which is accessing an external Api.
So do you think it is possible to get that property?
So do you think it is possible to get that property?
@woblet96 Unfortunately not, it's a bit beyond the capabilities of the Data List editor. (Due to how the Block List data can be accessed programmatically, it's effectively blobs of JSON in property data).
If I was tackling this scenario, I'd be tempted to roll my own custom property editor that would watch the value of the season
field (warning, it'd be ugly AngularJS traversing) and query an API controller with the value to get the items you need.
Thanks for the advice I ended up doing that in the end
Closing off this ticket, as unable to resolve it within Contentment/Data List.
Which Contentment version are you using?
4.6.0
Which Umbraco version are you using? For example: 10.3.2 - don't just write v10
13.1.1
Bug summary
We are trying to create a DataType (Race List) that takes a contextual Year value and returns a list of Races. We have created the DataType using the '[Contentment] Data List' With a Custom Data source following this guide Contentment for Umbraco
When calling
_contentmentContentContext.GetCurrentContent(out bool isParent);
we get a null response:Steps to reproduce
Data List source code
When viewing the Teams page with breakpoints 'var currentContent' gets a null value
Race List Data Type
Event Feed block
Content Page
Expected result / actual result
Expected result is the currentContent Actual result is Null
Do you have Umbraco ModelsBuilder enabled?
What browsers are you seeing the problem on?
Chrome