I have a Media Picker call "productImages" which resides in an element in an MNTP. I have the core property value converter installed. How do I get through to the image in the Media Picker? Have tried a few options, all fail on the var productImage line
Code:-
var accessoriesList = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("compatibleAccessories"); //The MNTP
var productImage = accessoriesList.GetPropertyValue<IPublishedContent>("productImage"); //The media picker
Compiler Error Message: CS1928: 'System.Collections.Generic.IEnumerable<Umbraco.Core.Models.IPublishedContent>' does not contain a definition for 'GetPropertyValue' and the best extension method overload 'Umbraco.Web.PublishedContentExtensions.GetPropertyValue<T>(Umbraco.Core.Models.IPublishedContent, string)' has some invalid arguments
Not sure if I should open this up again or start a new one, but it's essentially the same just 18 month and serveral versions on........
Umb 7.4.3, Slimsy 1.1.7 and Umbraco Core Property Value Converters.
1) VS complains "IPublishedContent does not contain a definition for GetResponsiveCropUrl.....". It's retrieving an image from a single source MultiMedia Picker. It worked before I added Slimsy and changed the src URL code.
2) HTML is output but no image shows. Have re-saved the image but to no avail.
For Item 1) I should mention Slimsy was installed with NuGet.
For item 2) I tried clearing cookies. However, have found that if I resize the browser window, the image appears, but doesn't on page load. So I guess it's a JS issue or clash with responsiveBP? I have img max-width set to 100%.
I think I've found the issue. Client wanted smooth animation from blank page load, so HTML has a background of #000 and body display:none initially. Then the animation JS kicks in and moves things around and gradually fades them up in opacity. This would explain why Slimsy isn't doing it's stuff until you get a browser resize.
Question is I suppose, is there some technique that will give the same end result and allow Slimsy to work? Maybe build the page content out of view, then set it's display to none, move it into the viewport then start the animation.
Sorry for the self-rumination. Hope it helps someone else with the same issue. I'll report back on results.
How to get to Media Picker within an MNTP
I have a Media Picker call "productImages" which resides in an element in an MNTP. I have the core property value converter installed. How do I get through to the image in the Media Picker? Have tried a few options, all fail on the var productImage line
Code:-
Any hints appreciated.
Craig
Hi Craig
What is the above code outputting currently? And is it correct to assume you're using v7.2.x? :)
/Jan
Hi Jan,
It's outputting-
Compiler Error Message: CS1928: 'System.Collections.Generic.IEnumerable<Umbraco.Core.Models.IPublishedContent>' does not contain a definition for 'GetPropertyValue' and the best extension method overload 'Umbraco.Web.PublishedContentExtensions.GetPropertyValue<T>(Umbraco.Core.Models.IPublishedContent, string)' has some invalid arguments
Hi Jan,
Sorted it. Completely cocked it up. Final code working:-
Looks good to me Craig!
Not sure if I should open this up again or start a new one, but it's essentially the same just 18 month and serveral versions on........
Umb 7.4.3, Slimsy 1.1.7 and Umbraco Core Property Value Converters.
1) VS complains "IPublishedContent does not contain a definition for GetResponsiveCropUrl.....". It's retrieving an image from a single source MultiMedia Picker. It worked before I added Slimsy and changed the src URL code.
2) HTML is output but no image shows. Have re-saved the image but to no avail.
Code:
HTML:-
Have tried putting the Slimsy JS code in header and where I'd normally put it, at the top of the JS file list in the bottom of the page.
Any help appreciated as I'm in my usual Umbraco syntax hell.
Thanks.
For Item 1) I should mention Slimsy was installed with NuGet.
For item 2) I tried clearing cookies. However, have found that if I resize the browser window, the image appears, but doesn't on page load. So I guess it's a JS issue or clash with responsiveBP? I have img max-width set to 100%.
Item 2) WRT: https://our.umbraco.org/projects/website-utilities/slimsy/slimsy-feedback/54003-Strange-resizing-of-images#comment-187327
I think I've found the issue. Client wanted smooth animation from blank page load, so HTML has a background of #000 and body display:none initially. Then the animation JS kicks in and moves things around and gradually fades them up in opacity. This would explain why Slimsy isn't doing it's stuff until you get a browser resize.
Question is I suppose, is there some technique that will give the same end result and allow Slimsy to work? Maybe build the page content out of view, then set it's display to none, move it into the viewport then start the animation.
Sorry for the self-rumination. Hope it helps someone else with the same issue. I'll report back on results.
No progress on item 1) VS issue though.
is working on a reply...