Skip to content
This repository has been archived by the owner on Sep 21, 2019. It is now read-only.
/ T4Utils Public archive

Utility Class and Demos for T4 Javascript Content Types.

License

Notifications You must be signed in to change notification settings

cwru/T4Utils

Repository files navigation

forthebadge

Ben Margevicius; bdm4@case.edu Version 1.0.4 5/18/2016 The latest build is in the T4Utils directory. Or you can install node.js, npm update, then run gulp to execute gulpfile.js script. Warning: jshint is throwing a ton of errors.

Github source: https://github.com/FPBSchoolOfNursing/T4Utils/

#Usage:
1) Add a content type, modify the content layout, paste this at the top of your layout. 
2) Your code will go below the T4Utils Object

#Examples:
T4Utils.write("Some text"); 
var sectionTitle = T4Utils.getSectionInfo.sectionTitle(section);
var pathToRootArray = T4Utils.getSectionInfo.getRootPath(section);

#Namespace extending:
T4Utils.blah = T4Utils.blah || {};
T4Utils.blah.hello = function() {
	T4Utils.write("hello");   
}	
T4Utils.blah.hello(); //writes hello

#Adding an image from the media library:
document.write(T4Utils.brokerUtils.processT4Tag('<t4 type="media" id="123288" formatter="image/*"/>'));

#Try catch with console error 

try {}
catch (err) {
	T4Utils.console.error(err.message);
}

#Help Dox
HowTo: https://community.terminalfour.com/how-to/-/programmable-layouts/
V7.X API Dox: https://community.terminalfour.com/info/api/sitemanager-7.3/index.html
V8 API Dox: https://community.terminalfour.com/info/api/terminalfour-8.0/

About

Utility Class and Demos for T4 Javascript Content Types.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published