You can use the
Media file data source web part in cooperation with the
Media gallery - file list web part to view all files within the appropriate media library. This media library can be chosen within the Media gallery – file list web part properties.
Once you have all the files in the data source, it is just about correct transformation. Basically, you'll need to have correct syntax when speaking about an external JavaScript Lightbox solution (or Colorbox). Just append the CSS styles and JavaScripts to the master page, and you are all set.
-it-
The image is resized to a smaller version, because it saves bandwidth. During this resizing, our internal file processing needs to be used, and that’s why the URL is automatically changed to a permanent one. You can override this behavior by setting the getPermanent variable, in the method
btnImagePreview_Click, within the file
CMSModules\Content\Controls\Dialogs\Properties\HTMLMediaProperties.cs, to false. With this setting, CSS styles will be used to resize the image.
-bp-
You can modify the transformation so it generates also link and not only preview image. The link could point to some document with Media Gallery web part and could contain LibraryName as query string parameter.
For example:
~/GalleryDetail.aspx?libname=<%# Eval("LibraryName") %>
The Media Gallery web part would get the Library name and use it. You can use following macro in Library name attribute of Media Gallery web part: {?libname?}
The system uses the resized versions of media files only if you use the permanent URLs. Please see the settings in:
Site manager -> Settings -> Media libraries -> Site: <your site> -> Use permanent URLs
If the checkbox is unchecked it does not use the resized images from disk. If you check the checkbox it can greatly improve the page performance.
There is mistake in sample code in documentation. We are very sorry for this inconvenience. Basically you only need to change following line in example:
if (this.Type.TrimStart('.').ToLower() == "flv")
to:
if ((this.Type != null) && (this.Type.TrimStart('.').ToLower() == "flv"))