Ok, so your media item cropper property alias is "umbracoFile" (but named cropper) so you don't need to specify it also we need to get rid of that ToList(), and the slider should be activated on the Slimsy JS ready callback, so your code should be:
Hi There, I too am using this banner and it suddenly developed a problem with the following, did you experince this?
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 29:
Line 30: <div class="banner-text">
Line 31: <h2>@(banner.GetPropertyValue<string>("headline"))</h2> Line 32: <a href="@link.Url" class="button">@(banner.GetPropertyValue<string>("linktext")) <i class="fa fa-external-link-square"></i></a>
Line 33: <p>@Html.Raw(banner.GetPropertyValue("subheadline"))</p>
Convert Banner partial to Slimsy
I am using the from [http://carlosmartinezt.com/2014/06/umbraco-7-and-mvc-practical-examples-part-2/][1]
I would like to use slimsy or image cropper. Do i need to declare a var like Banner Images?
Hi Keith,
The Razor part looks fine, does it work?
Jeavon
VS 2013 states it does not have a definition for GetResponsiveCropUrl. this is a partial
ah ok, could you check /Views/Web.Config in the namespaces section you should have:
The web.config has it
hmm, might just be VS confused, does it run?
Images are huge dev.outtasightwraps.com
Ok, so first on the VS issue, close your solution, delete the SUO file, open the solution and then build, now wait for it.
On the images themselves, I'm guessing you've changed "banner" from upload to image cropper but you need to resave the images...?
I have done all of this with no luck.
Ok, so your media item cropper property alias is "umbracoFile" (but named cropper) so you don't need to specify it also we need to get rid of that ToList(), and the slider should be activated on the Slimsy JS ready callback, so your code should be:
This will kinda get it working however the image needs to have a width and height set in CSS for it all to work.
For a test you can add a width and height to the containing div e.g:
Maybe I need to find a more responsive slider. this banner works but does not seem to compliment slimsy. any suggestion?
Are you sure, it seemed ok to me. You just need to get your images being sized by CSS?
A alternative that I know a few are using with Slimsy is bxSlider
Hi There, I too am using this banner and it suddenly developed a problem with the following, did you experince this?
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 29: Line 30: <div class="banner-text"> Line 31: <h2>@(banner.GetPropertyValue<string>("headline"))</h2> Line 32: <a href="@link.Url" class="button">@(banner.GetPropertyValue<string>("linktext")) <i class="fa fa-external-link-square"></i></a> Line 33: <p>@Html.Raw(banner.GetPropertyValue("subheadline"))</p>
Source File: d:\home\site\wwwroot\Views\Partials\homepageManyBanners.cshtml Line: 31
Stack Trace:
Looks like "banner" is null, do you have a check? Perhaps you could post the entire partial view?
Thanks!
Ah ok, probably one of the banners has been deleted, try this:
Thats the weird thing...nothing has been deleted only a new media fodler added. Tried your code and i still get the error.
Worked it out...my banner were allowed to link to internal pages...one of those pages had been deleted! Thanks for your input...got me thinking!
S
Np, glad you solved it!
Hi,
I too have the same problem. But it shows error on this line "var mediaFolder =Umbraco.TypedMedia(mediaFolderId);". How can I solve this ?
is working on a reply...