DNN Global Gallery - Documentation

DNN Global Gallery module: Quick Guide

Last Updated: Mar 3, 2018

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:ItemFolderPath], [GlobalGallery:ItemPermissions], [GlobalGallery:ItemBreadcrumbs]

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, ParentFolderID, FolderPath, LastModifiedByUserID, CreatedByUserID, LastModifiedByUserName, CreatedByUserName, LastModifiedOnDate, CreatedOnDate, FriendlyLastModifiedOnDate, FriendlyCreatedOnDate, Size, SizeBytes, ThumbUrl, IsGoBack

About date tokens

Date fields can accept the following formats: d, D, F, g, G, M, m, t, T, s, u, Y, y

Example output of each format:
  d = 10/6/2000
  D = Monday, November 06, 2000
  F = Monday, November 06, 2000 12:00:00 AM
  g = 11/6/2000 12:00 AM
  G = 11/6/2000 12:00:00 AM
  m = November 06
  M = November 06
  t = 2:30 PM
  T = 2:30:45 PM
  s = 2000-11-06 00:00:00
  u = 2000-11-06 00:00:00Z
  Y = November, 2000
  y = November, 2000

Building a custom date-time format

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

Specifier Result
"d" Renders the day of the month, from 1 through 31.
"dd" The day of the month, from 01 through 31.
"ddd" The abbreviated name of the day of the week.
"dddd" The full name of the day of the week.
"f" The tenths of a second in a date and time value.
"ff" The hundredths of a second in a date and time value.
"fff" The milliseconds in a date and time value.
"M" The month, from 1 through 12.
"MM" The month, from 01 through 12.
"MMM" The abbreviated name of the month.
"MMMM" The full name of the month.
"h" The hour, using a 12-hour clock from 1 to 12.
"hh" The hour, using a 12-hour clock from 01 to 12.
"H" The hour, using a 24-hour clock from 1 to 23.
"HH" The hour, using a 24-hour clock from 01 to 23.
"m" The minute, from 0 through 59.
"mm" The minute, from 00 through 59.
"s" The second, from 0 through 59.
"ss" The second, from 00 through 59.
"tt" The AM/PM designator.
"yy" The last two characters from the year value.
"yyyy" The year full value.
"zzz" The local timezone when using formats to parse UTC date strings.

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.

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:Breadcumbs]

Folder Actions Tokens

[GlobalGallery:Refresh], [GlobalGallery:Upload], [GlobalGallery:AddFolder]

Action Tokens

[GlobalGallery:EditItem], [GlobalGallery:DownloadItem], [GlobalGallery:EncodedDownloadItem], [GlobalGallery:EncodedEditItem]

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.

What people are saying...