Releases: virginiacommonwealthuniversity/T4Utils2
Ordinal Indicators Enhancement
This update enhances the structure, performance, and extensiveness of the ordinalIndicators
module; Here's how:
- Both the
pageInfo
andgroupInfo
methods have been merged into one self-executing function:info
- Now you can grab all page/group information via
ordinalIndicators.info
- Now you can grab all page/group information via
- More information about groups is available
ordinalIndicators.groupAmount
- The total amount of groups on the pageordinalIndicators.groupCount
- The total amount of content within the current groupordinalIndicators.groupID
- The ID of the current group (zero-based)ordinalIndicators.groupIndex
- The index of the current piece of content within the group (zero-based)
publishCache Microsite Fix
This update fixes an issue with publishCache.microsite
; This module variable is now working as intended. Here's some other updates:
- T4Utils2 is dropping support for v7.4
- The v7.4 release of 1.6.0 has been pulled for API discrepancies and errors
- Maintenance of one utility file with drastically different API calls is no longer feasible
- Build system files have been further simplified and upgraded to ES2015 (ES6)
publishCache Module
This update brings a much needed publishCache
module to T4Utils. Here's what you can do with it:
publishCache.channel
- Returns a data object containing information about the current channelpublishCache.microsite
- Returns, if at all possible, a data object containing information about the current microsite
Check the source file to see the types of information you can pull from these objects!
generateT4Tag() v7 Bug Fix
This is a v7 bug fix for brokerUtils
's module generateT4Tag()
. Here's the scoop:
- T4 was processing the tag templates before being loaded into a content type or page layout.
- No matter how this module was used, an empty string was always returned
- The first
<
of the tag template has been replaced with the unicode equivalent\u003C
generateT4Tag()
The brokerUtils
module has been extended to include generateT4Tag()
!
- Create/process T4 tags by passing in a configuration object
- type (content, media, navigation, title)
- type - string
- default - "content"
- name
- type - string
- default - ""
- output
- type - string
- default - "normal"
- modifiers
- type - array
- default - []
- id
- type - number
- default - 0
- formatter
- type - string
- default - ""
- type (content, media, navigation, title)
v7.4 Support
T4Utils2 now officially supports both TerminalFour v7.4 and v8.1. Here's what's changed:
- The Gulp build system now compiles 2 versions of the library (for TerminalFour v7.4 and v8.1)
- The main
gulpfile.js
now uses a build module to simplify and bootstrap library compilation code
- The main
- The
ordinalIndicators
module now uses replaceable strings for any v7.1/v8.1 API discrepancies- These replaceable strings are changed to the correct API calls during the build process
- The
elementInfo
module has had undefined variable issues fixed - The
media
module'sgetImageVariantsIds
method is now wrapped in aT4Utils.contextIsContent
conditional
Global Context Variables
Issues related to the var context = content || null;
problem within page-layouts have been solved. Here's how:
- In page-layouts, the original way of calculating context errors out. The following logic works and will be utilized:
var context = typeof content == 'undefined' ? null : content;
- All new
context
,contextIsPage
andcontextIsContent
member variables have been added to the baseT4Utils
object- This ensures that the context is defined globally at the start of the library
- The modules
brokerUtils
,elementInfo
andordinalIndicators
now utilize these member variables in their logic
Ordinal Indicators Failsafe
A new failsafe has been added to ordinalIndicators
to allow for the entire library to be used within page layouts. Here's what's changed:
- All code within pageInfo/groupInfo has been wrapped in a conditional checking to see if the global variable
content
is undefined- If
content
is defined, the self-executing functions will run as expected - If
content
is undefined, the self-executing functions will return objects with null key/value pairs
- If
Ordinal Indicators - pageCount
A new pageCount
member variable has been added to ordinalIndicators
.
- Returns the amount of content (of the kind in which the variable is called) on the page
Ordinal Indicators Optimization
ordinalIndicators
have been optimized in a few ways for speed and efficiency, and new features have been added. Here's what's changed:
- New functions
pageInfo
andgroupInfo
have been addedpageFirst
,pageIndex
, andpageLast
are now aliases for key/value pairspageInfo
returnsgroupFirst
andgroupLast
are now aliases for key/value pairsgroupInfo
returns
- Comments are more contextual
- Syntax is simplified to utilize cleaner, more understandable code