Doing my head in, can't get a crop. Code below but this is a webforms U7 project so not able to use the MVC stuff so any suggestions how to get this working appreciated.
Scenario: Folder of images, need to display in a carousel slideshow but at the right crop - crop is called slideshow and another called thumbs for the nav. Simple eh, ermm no!
You will see two methods i've tried below - giving up for now as just can't fathom it but maybe some sleep will help :-)
@inherits DynamicNodeContext @usingumbraco.MacroEngines @{ var media = Library.MediaById(1386); if (media !=null&& media.Children.Count() > 0) { <divclass="container slideshow"> <divclass="row"> <divclass="col-xs-12 col-md-10 col-md-offset-1">
I never got it to work in a regular razor macro, only a Partial View Macro, but I guess thats not an option for you? Or can you put a Partial View Macro in a WebForms masterpage?
Good work! @Simon, I would recommend that you convert as many legacy "Razor Macros" to "Partial View Macros" as you can. You will see dramatic improvement in performance by doing so and you can just change the file in the macro from the old MacroScript to the Partial View Macro without having to change the template (masterpage).
Umbraco 7 Image cropper and webforms?
Doing my head in, can't get a crop. Code below but this is a webforms U7 project so not able to use the MVC stuff so any suggestions how to get this working appreciated.
Scenario: Folder of images, need to display in a carousel slideshow but at the right crop - crop is called slideshow and another called thumbs for the nav. Simple eh, ermm no!
You will see two methods i've tried below - giving up for now as just can't fathom it but maybe some sleep will help :-)
Hi Simon
I never got it to work in a regular razor macro, only a Partial View Macro, but I guess thats not an option for you? Or can you put a Partial View Macro in a WebForms masterpage?
/Bo
Hi Simon
In case you want to try PVM:
My SliderImages property is a MNTP in this case
/Bo
Thanks Bo - i'll give it a try, can't understand though why a razor macro won't work though or not usable? Will update later :-)
Cheers Bo - got it sorted now, for anyone else, the final code as a partial view is below:
Good work! @Simon, I would recommend that you convert as many legacy "Razor Macros" to "Partial View Macros" as you can. You will see dramatic improvement in performance by doing so and you can just change the file in the macro from the old MacroScript to the Partial View Macro without having to change the template (masterpage).
is working on a reply...