DNN GlobalGallery module - Documentation

DNN Global Gallery module: Quick Guide

Last Updated: Jan 16, 2017

Templates

Built-in templates are shipped with the product. They are saved under \DesktopModules\Evotiva-GlobalGallery\Templates.

User (Custom) templates are expected to be under \Portals\_default\Evotiva-GlobalGallery\Templates.

In any case, each subfolder of any of these roots is a template, and typically will include most of the files included in the default template.

Some files are optional (Template.js, Template.resx), and subfolders such as \images are specific to each template (they may on may not exist, depending on each template).

Template Files

Template.html

Defines the general layout of the module. It should include at least a [GlobalGallery:Items] token.

Item.html

Defines how each item (files and folders) will be rendered.

Gallery.html

Defines how the look and content of full screen gallery opened when an item is selected (and the 'Enable Gallery' setting is active).

It should include an id="blueimp-gallery-[Module:ModuleId]"

TemplateNoItems.html

This will be rendered when no items are found, and is referenced in the Template.html by the [GlobalGallery:NoItems] token.

Template.css

CSS styles that applies to the template.

Template.js

Optional file for custom JS code relative to the template and gallery contents. 

It can include custom actions related with some module's events: onEvotivaGlobalGalleryOpened(), onEvotivaGlobalGalleryClosed(), and onEvotivaGlobalGallerySlide(). The best way to lern about them is to see the files included in the default template.

Template.resx

Optional file, for texts localization. (see 'Template Localization' below).

Template Localization

There are two ways to localize templates.

1. have a folder for each language. At run-time the module will pick one, with the same criteria that applies to DNN's RESX files.

For example, you can have  \MyTemplate, \MyTemplate.es-UY, \MyTemplate.es-UY.Host, \MyTemplate.es-UY.Portal-0, etc.

(see http://www.dnnsoftware.com/wiki/page/how-to-customize-edit-a-modules-language-pack)

2. keep a single \MyTemplate, and rely on its Template.resx for text localization. The same standard DNN logic applies for this Template.resx file. You can have (in the same folder) localized version such as Template.es-UY.resx, etc.

Note: Of course, if you don't need to worry about localization, you can hardcode text in the template files. Besides, the module's SharedResources.resx includes default values for many texts. If the text key isn't found in the template's Template.resx, it is then loaded (if exists) from  the module's SharedResources.resx file.

Template Tokens

Notes:

- It supports all the standard DNN tokens (see http://www.dnnsoftware.com/wiki/page/tokens)

- The tokens are not case sensitive (they can can be written in any combination of upper and lower case).

- Besides the standard DNN notation ([Object:Property],  [Object:Property|Format]), the DNN GlobalGallery module support the following notation:   [Object:Property|RESX:Format]. This will get the 'format' text from the active Template.resx file.

Example: [GlobalGallery:PageCount|RESX:PageCount].
You can see more examples of this in the Default template.

The tokens specific to this module (for which usage examples are available in the built-in default template files) are: 

Tokens relative to items' properties

[GlobalGallery:ItemId], [GlobalGallery:ItemName], [GlobalGallery:ItemTitle], [GlobalGallery:ItemDescription], [GlobalGallery:EncodedItemDescription], [GlobalGallery:ItemSize], [GlobalGallery:ItemSizeBytes], [GlobalGallery:ItemExtension], [GlobalGallery:ItemContentType], [GlobalGallery:ItemUrl], [GlobalGallery:ItemLocalUrl], [GlobalGallery:ItemThumbUrl], [GlobalGallery:ItemLastModifiedBy], [GlobalGallery:ItemCreatedBy], [GlobalGallery:ItemLastModifiedOnDate], [GlobalGallery:ItemCreatedOnDate], [GlobalGallery:ItemFriendlyLastModifiedOnDate], [GlobalGallery:ItemFriendlyCreatedOnDate], [GlobalGallery:ItemDownloadCount], [GlobalGallery:ItemTags], [GlobalGallery:ItemTagsRaw], [GlobalGallery:EncodedItemTags], [GlobalGallery:ItemEditAllowed], [GlobalGallery:ItemDownloadAllowed]

About 'raw' data values

Besides these tokens, in JavaScript expressions you can reference raw data values directly. This could be useful for some advances usages. For example, to implement some functionality related with the file's permissions, etc.

The following data values are available: IsFolder, ItemID, ItemName, ParentFolderID, FolderMappingID, FolderProviderType, FolderPath, LastModifiedByUserID, CreatedByUserID, LastModifiedByUserName, CreatedByUserName, LastModifiedOnDate, CreatedOnDate, FriendlyLastModifiedOnDate, FriendlyCreatedOnDate, Size, SizeBytes, ThumbUrl

About date tokens

Date fields can accept the following formats: F, d, D, t, T, F, M, m, s, Y and y.

Example output of each format:
  F = Saturday, May 03, 2014 7:06:54 PM
  d = 4/26/2014
  D = Saturday, May 03, 2014
  t = 7:24 PM
  T = 7:24:26 PM
  M = April 26
  m = April 26
  s = 2014-05-03T19:06:54
  Y = May, 2014
  y = May, 2014

Building a custom date-time format

You can also specify a custom format. For example: [GlobalGallery:LastModifiedOnDate|dd MMMM yyyy hh:mm tt]

d Represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero
dd Represents the day of the month as a number from 01 through 31. A single-digit day is formatted with a leading zero
ddd Represents the abbreviated name of the day of the week (Mon, Tues, Wed etc)
dddd Represents the full name of the day of the week (Monday, Tuesday etc)
h 12-hour clock hour (e.g. 7)
hh 12-hour clock, with a leading 0 (e.g. 07)
H 24-hour clock hour (e.g. 19)
HH 24-hour clock hour, with a leading 0 (e.g. 19)
m Minutes
mm Minutes with a leading zero
M Month number
MM Month number with leading zero
MMM Abbreviated Month Name (e.g. Dec)
MMMM Full month name (e.g. December)
s Seconds
ss Seconds with leading zero
t Abbreviated AM / PM (e.g. A or P)
tt AM / PM (e.g. AM or PM
y Year, no leading zero (e.g. 2001 would be 1)
yy Year, leadin zero (e.g. 2001 would be 01)
yyy Year, (e.g. 2001 would be 2001)
yyyy Year, (e.g. 2001 would be 2001)
K Represents the time zone information of a date and time value (e.g. +05:00)
z With DateTime values, represents the signed offset of the local operating system's time zone from Coordinated Universal Time (UTC), measured in hours. (e.g. +6)
zz As z but with leadin zero (e.g. +06)
zzz With DateTime values, represents the signed offset of the local operating system's time zone from UTC, measured in hours and minutes. (e.g. +06:00)
f Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value.
ff Represents the two most significant digits of the seconds fraction; that is, it represents the hundredths of a second in a date and time value.
fff Represents the three most significant digits of the seconds fraction; that is, it represents the milliseconds in a date and time value.
ffff Represents the four most significant digits of the seconds fraction; that is, it represents the ten thousandths of a second in a date and time value. While it is possible to display the ten thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
fffff Represents the five most significant digits of the seconds fraction; that is, it represents the hundred thousandths of a second in a date and time value. While it is possible to display the hundred thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
ffffff Represents the six most significant digits of the seconds fraction; that is, it represents the millionths of a second in a date and time value. While it is possible to display the millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
fffffff Represents the seven most significant digits of the seconds fraction; that is, it represents the ten millionths of a second in a date and time value. While it is possible to display the ten millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.
F Represents the most significant digit of the seconds fraction; that is, it represents the tenths of a second in a date and time value. Nothing is displayed if the digit is zero.
: Represents the time separator defined in the current DateTimeFormatInfo..::.TimeSeparator property. This separator is used to differentiate hours, minutes, and seconds.
/ Represents the date separator defined in the current DateTimeFormatInfo..::.DateSeparator property. This separator is used to differentiate years, months, and days.
" Represents a quoted string (quotation mark). Displays the literal value of any string between two quotation marks ("). Your application should precede each quotation mark with an escape character (\).
' Represents a quoted string (apostrophe). Displays the literal value of any string between two apostrophe (') characters.
%c Represents the result associated with a c custom format specifier, when the custom date and time format string consists solely of that custom format specifier. That is, to use the d, f, F, h, m, s, t, y, z, H, or M custom format specifier by itself, the application should specify %d, %f, %F, %h, %m, %s, %t, %y, %z, %H, or %M. For more information about using a single format specifier, see Using Single Custom Format Specifiers.

The 'encoded' flavor of a token will html encode the value. See the Item.html template for usage examples.

The 'friendly' flavor of a token will render a human-friendly relative date, such as "just now", "yesterday", "2 weeks ago", etc. These texts are localized in the template's "Template.resx" file.

The "Size" is also friendly, providing texts such as "10 KB", "4 GB", etc.; while the "SizeBites" provides the raw file's size expressed in bytes.

The "TotalItemsCount" token is useful when you want to show the downloads count for the file (when you have the 'downloads traking' feature enable in the module's settings page.

Flag Tokens

[GlobalGallery:TagsDisabled], [GlobalGallery:TitleEditingDisabled], [GlobalGallery:DesciptionEditingDisabled], [GlobalGallery:DownloadingDisabled], [GlobalGallery:TrackDownloadsDisabled], [GlobalGallery:RefreshDisabled]

General Tokens

[GlobalGallery:RESX:|key] gets a text from the template's "Template.resx" file or the module's SharedResources.resx file. Example: [GlobalGallery:RESX|ItemName.Item]

[GlobalGallery:QueryString|element] gets the element's value from the url query string

[GlobalGallery:NoItems] defines in Template.html the placeholder for the 'no items found'.

[GlobalGallery:Items] defines in Template.html the placeholder for the items.

[GlobalGallery:Pager] defines in Template.html the placeholder for the pager.

Feature Tokens

[GlobalGallery:SearchBox], [GlobalGallery:Refresh] and [GlobalGallery:Upload], [GlobalGallery:EditItem], [GlobalGallery:DownloadItem], [GlobalGallery:EncodedDownloadItem]

There is a variation available for the [GlobalGallery:DownloadItem] token: [GlobalGallery:DownloadItem|ITEM:xxx]
xxx can be any of the supported properties. ItemId, ItemName, ItemTitle, FolderPath, Size, SizeBytes, Type
This means that you can turn any of these properties a download URL.

Some examples of the possible variations of the download token:

    <div class="eg-gall-dw">[GlobalGallery:DownloadItem]</div>
    <div>[GlobalGallery:DownloadItem|Download File]</div>
    <div>[GlobalGallery:DownloadItem|RESX:FileDownload]</div>
    <div>[GlobalGallery:DownloadItem|ITEM:ItemName]</div>

The first example, is utilized in the default template. The CSS class will show an image users can click to download the file.
The 2nd. example, uses the hardcoded 'Download File' text for the download link.
The 3rd. example instead of a hardcoded text utilized localized text (found in the template's Template.resx file).
The 4th. example uses the File's Name for the download link.

Using the Module

- As Host or Admin some additional settings will be available on its settings page.

- If a 'pattern' was configured, the module will create at run-time all the missing folders. They will inherit their permissions form its parent folder.

One exception to this is when 'enable uploads' is active. In this case, the final (lower level) folder will not include permissions for 'all users', and will include read and write permissions specific for the current user. This is ideal when the pattern is utilized to create user-specific folders (example pattern: "[Module:FriendlyName]/[User:Username]") . This behavior ensures that only the user (besides host and admins) will have access to their own folder.
Notice that from the DNN File Manager you can always change the folder's permissions in the way you like.

About the "Root Folder Pattern" Setting

In this setting, you can define additional items (static and dynamic) that will be added 'at runtime' to the root folder that was defined. It supports tokens, such as [User:...], [Profile:...], [Module:...], [Tab:...], etc.

For user's Profile properties to work properly, when defining the property (in DNN Admin > Site Settings > User Account Settings > Profile Settings), remember to make it visible to the user. Otherwise, at runtime the token cannot be solved by DNN.Besides, please notice these DNN profile properties does not work for "host" accounts.

Getting the latest version of the Module

The latest version of the module is always available for download at http://www.evotiva.com/Downloads.

Installing the Module

Install the module on your DNN portal as any other standard module, from Host > Extensions.
In the http://www.evotiva.com/Products/DNNGlobalGallery/Demo-Videos page, you can find a demo video showing how install the module and apply your license key.

Installing the the License Key

Manual Process

Request the License

Before installing the license key, you have to email us to licensing at evotiva.com requesting your key.
Please use the "Activation" link available on the module's Settings page, and don't forget to include your invoice number in the request.

Install the License Key

Once you get the license from us, please install your it by visiting the module's settings page.
In the http://www.evotiva.com/Products/DNNGlobalGallery/Demo-Videos page, you can find a demo video showing how install the module and apply your license key.

Auto-Install the License Key

Optionally, you can rename your license key (sent as a TXT file) as Evotiva.DNNGlobalGallery.LicenseKey.resources, and save it in the /Portals/_default folder.
The key will be auto-installed the next time you visit the page where the module is. You can verify it if was installed visiting the module's Settings page, and reviewing the License Settings section.

Choose your Evotiva-DNNGLOBALGALLERY Option:

Testimonials

5.0 review rating Peter V says...

quote Great add on for the file manager in DNN! Very good service. Quick replies. Thanks!

more reviews...