I have a few questions regaring the use of Item types and Razor templates.
We are using DW v8.3.1.18 and do not want to upgrade to 8.4 until it is deemed a stable version
We Have an Item Type for Category. We select from a checkbox list the
categories on each Item Type Product (multiple categories for each product)
We wish now to filter for products in each category.
I have two versions of this product Item Type,
V1 we set the checkbox values with the dropdown select on Category_Name
this is the current DW way.
V2 we set the Category_Id as the value for the checkboxes, this is done by
manually changing the MetaData for this control (Id selection is not
allowed)
V2 took me 20 mins to write a Razor Template to complete the desired
filtering and its accurate based on the Id.
V1 still cannot be completed. Since there is a problem in DW Razor implementation
- we cannot use System.Web.HttpUtility.HtmlEncode("txt");
or the accepted Razor implementation - @Html.Encode("txt");
There seems to be no implementation for encode/decode html in DW Razor so
our URLs do not get mangled, since in V1 we are filtering on the Category_Name. This is a major flaw (unless Im missing
something?)
Also - Why can we not debug Razor Templates in VS when running in dev? /Files
folder is a virtual directory and a web site not a web application but
should run in the shared AppPool
I have managed to debug the c# code in a seperate class library project in
the main solution and then copy the code back into the template,
but still looses the DW Templating API and then requires a lot of
guesswork tweeking afterwards.
Other experiences - Images stored on Item Types get forgotten by the Item Type (ie the
image links gets deleted from the database when the Item type on the
paragraph is re-opened)
The file is set to a Base directory other than the default /Files ( like
/Files/Schools) and extensions are restricted .jpg,.png,.gif
When the defaults are reset we see the images not being deleted.
I have also seen some paragraphs forgetting that an Item type is
attached (Ive had to update the Paragraphs table manually in the db to
re-implement these)
Do you have any solutions for these problems?