Using the Model of an updated Data Type in a parial view
Hello,
I am working on a staging site that is running, and want to update the way a partial view is using the model of a Data Type.
For instance the (archetype) data type previously allowed the user to select one image and I want to allow the user to select two images which then should be accessible from a new or updated partial view.
I added a second media picker property to the data type and that is visible to the backoffice user. However when I write a block in the partial view that tries to access the data the user selected the site will produce a 500 error whenever that partial is loaded.
Here I added a media picker property named sImage to the DataType that already had a media picker named Image. And tried to access it in a partial like so:
I am guessing this is because changing the Data Type properties etc doesn't actually change the model? Is there some way to update the model or a trick to access new properties of a Data Type without updating the model? I might be misunderstanding the relationship between Data Types and the models.
Using the Model of an updated Data Type in a parial view
Hello,
I am working on a staging site that is running, and want to update the way a partial view is using the model of a Data Type.
For instance the (archetype) data type previously allowed the user to select one image and I want to allow the user to select two images which then should be accessible from a new or updated partial view.
I added a second media picker property to the data type and that is visible to the backoffice user. However when I write a block in the partial view that tries to access the data the user selected the site will produce a 500 error whenever that partial is loaded.
Here I added a media picker property named sImage to the DataType that already had a media picker named Image. And tried to access it in a partial like so:
I am guessing this is because changing the Data Type properties etc doesn't actually change the model? Is there some way to update the model or a trick to access new properties of a Data Type without updating the model? I might be misunderstanding the relationship between Data Types and the models.
Thanks for any help!
Hi jtrip,
What error exactly do you have?
Can you share text of exception?
Maybe Model.sImage is null?
What is IsSet() method?
Thanks,
Alex
is working on a reply...