Reputation: 55
I want to create a bootstrap image carousel in Kentico 11 while fetching the images from the media library. Is there any step by step guide creating that in a page?
Upvotes: 0
Views: 438
Reputation: 451
I suggest using the Media Gallery Web Part (if you are using Portal Engine). You need to set:
UPD: Transformation Example see below:
<a rel="lyteshow[4]"
href="<%# HTMLHelper.HTMLEncode(MediaLibraryFunctions.GetMediaFileUrl(Eval("FileLibraryID") ,Eval("FilePath"), Eval("FileGUID"), Eval("FileName"), GetDataControlValue<bool>("UseSecureLinks"), false)) %>?ext=<%# Eval("FileExtension", true) %>"
title="<%# ResHelper.GetString(Convert.ToString(Eval("FileDescription", true))) %>"><img
src="<%# MediaLibraryFunctions.GetMediaFileUrl(Eval("FileGUID"), Eval("FileName")) %>"
alt="<%# ResHelper.GetString(Convert.ToString(Eval("FileDescription", true))) %>"
title="<%# ResHelper.GetString(Convert.ToString(Eval("FileTitle", true))) %>"
width="140" border="0" /></a>
Upvotes: 0
Reputation: 59
I would follow the below steps :-
Upvotes: 1
Reputation: 470
if you're using portal engine have a look at the documentation for creating a new Web Part. The dynamic component, which in your case would be an image carousel)
https://docs.kentico.com/k11/custom-development/developing-web-parts/creating-new-web-parts
Or have a look at default Image gallery Web Part, which renders a number of images.
Depending on the implementation, but regarding to getting items from the Media library directly using API, try the API examples on:
https://docs.kentico.com/api11/content-management/media-libraries
Where you end up with something like:
MediaFileInfo myFile = MediaFileInfoProvider.GetMediaFileInfo(library.LibraryID, "NewFolder/Image.png");
Upvotes: 0