@Sebastiaan, thanks for the help. Razor is a very intuitive syntax, I just wrote some code that seemed logical to me and I was almost there. This is what strikes me about Razor, it feels so natural to write. The image parameter I forgot was just some slopiness on my side. In the meantime I got my script up and running.
using ImageGen in Razor script
Hi,
I never used ImageGen in a Razor script.
I wrote this code:
dynamic file = Model.eventImage.mediaItem.EventImage;
<img src="[email protected]&width=200px" class="eventimage" />
but obviously this doesn't work
Thanks for your help,
Anthony
Almost there, make it "/imageGen.ashx" instead and it should work just fine!
Make sure that @file.umbracoFile returns the filename though (and that imageGen.ashx is in the root folder of your site).
Just noticed, you forgot the image parameter, so to make it work, try:
...And it should not be neccesary to add the "px" to the width :)
/Jan
@Sebastiaan, thanks for the help. Razor is a very intuitive syntax, I just wrote some code that seemed logical to me and I was almost there. This is what strikes me about Razor, it feels so natural to write. The image parameter I forgot was just some slopiness on my side. In the meantime I got my script up and running.
@Jan, thanks for your suggestion
greetings,
Anthony
is working on a reply...