Developer forum

Forum » CMS - Standard features » Nested Items don't read AreaId

Nested Items don't read AreaId

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,
I will try to explain the subject of this task.

I have an Item type with an ItemRelation list. On the related ItemType, I have defined a Theme selector (Radiobox list with the Swift_ThemeSelectorMini.cshtml template.
The template is using the AreaId property of the Model to determine the right place to read the themes from and the Style associated with it.
On the parent ItemType it works correctly and the Model is returning correctly the AreaId property. On the related ItemType, it does not return any AreaId property (empty or not) causing the load of a Swift_styles_0.min.css which, obviously, does not exist.

I believe this is a bug.

Thank you,
Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

I believe not :-).

The item could be related to whatever and is context in-sensitive. Meaning the same item could be related into several lists having different areaid.

But pls share some code from the template - it might shed some light and there might be other solutions.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai.

It is possible I have not explained it correctly.
Here is a screencast: https://app.screencast.com/QuBUovcqDE8ce  the sound is pretty bad, I apologize, but you will probably figure it out.

I have also compared now the code of the Swift_ThemeSelectorMini.cshtml of the latest version with an earlier one. The method for handling the value for AreaId was different in the older version and it was based on the ID value from the query string instead of the property AreaId of the Model. And it worked. The new one does not work anymore.

I hope it makes sense.

Thank you,
Adrian

 

You must be logged in to post in the forum