As our web site evolves, we want to make sure that we are giving you tools and features that will allow you to build your site in new and more advanced ways, but without making the process harder. One thing that dotCMS allows is the introduction of custom macros, or lines of code that make complex tasks very easy. This is much like any other macro you might use, for instance in Microsoft Office. For a guide to the custom macros available to you in our installation of dotCMS, just click one of the options below.
Contact Box
In the PSU templates "Body - Office Template" or "Body - Department Template," you might have noticed that there is a built in contact box beneath the left side navigation. However, there are times where you might want to use one of the generic body templates for a different layout, but still have a contact box on the page. To do this, you first need to create a new Promo content item. The following instructions will tell you what to put in the content item.
Syntax: #psuContactInfo("$DepartmentName")
Arguments:
$DepartmentName : The name of the department or office that you wish to call contact information for, as listed in the "Department / Office" structure.
Example: #psuContactInfo("Communication")
Back to Top
Custom Event Listing
Creating an event listing allows you to specify a category or tag that will create an automatically updating list of events for you page. You can specify a number of parameters to customize this feed.
Syntax: #pullEventListByTag("$calendarTag")
Arguments:
$calendarTag : This is the specific tag that you'd like to pull in that defines the events you wish to see. If using this macro to pull an entire calendar, just set this to empty quotes, like ("").
Optional Arguments:
$eventNum : Change the default number of events to show in your listing. Defaults to 10.
$listTitle : Change the default heading generated at the top of the event listing. Defaults to "Related Events."
$eventCal : Pull a specific category of the calendar, such as the Academic Calendar or the Arts events. Can be combined with the $calendarTag parameter to pull specifically tagged events from a specific calendar. Must be set to the category inode of the calendar you want to use. Contact the CMS administrator for this value.
$eventSpan : Make the system look further into the future if you have long spans of time without events. Default: 62 days.
$eventCalID : An array list of category IDs to pull from for the calendar. No default. Not intended for individual use.
Example: #pullEventListByTag("athletics")
Advanced Example: #set($listTitle = "Theatre Performances") #set($eventNum = "4") #pullEventListByTag("play")
Back to Top
Display a highlighted story
Creates a tan, rounded corner box that pulls in a predefined story content item and displays it with a picture, title, and summary.
Syntax: #pullHighlightStory("$storyID")
Arguments:
$storyID : The specific identifier for the story you wish to highlight. To get a story's ID, navigate to the story that you wish to highlight in your browser and not the URI it sends you to, it will be in the format of /stories/detail.dot?id=
Example: #pullHighlightStory("12345")
Back to Top
Paginated Navigation
The pageContentNavigation() macro should only be used in conjunction with the pageContent() macro on pages where content is being pulled and you need to be able to navigate through the pages of results. This automatically builds a forward and backward linking system that will automatically update the results and pass through the proper page variable for the pageContent() macro.
Syntax: #pageContentNavigation("$pageNumber")
Arguments:
$pageNumber - Integer value for the current page number. This is generally passed as a variable that was previously used in the pageContent() macro if working with dynamic pages, but can also be an integer value.
Optional Arguments:
$p revPageTxt : Text for the previous page link. Default: "« Previous Page"
$nextPageTxt : Text for the next page link. Default: "Next Page »"
$showPageNum : Show the page number between the navigation links. Display is in the format of # of $pageLinkVar : Any necessary parameters to pass to the page for the query. Used only on pages generated dynamically. Should end with an "&".
$pageVarName : Variable name in the URI for the page number that is being used in the pageContent() macro. Default: "page"
$pageNavClass : Customizable CSS class name for the navigation and its elements. Default: "pageContentNav"
Example: #pageContentNavigation("3")
Advanced Example: #set($showPageNum = "true") #set($prevPageTxt = "View Newer Articles") #set($nextPageTxt = "View Older Articles") #set($pageLinkVar = "catName=college&id=37&") #pageContentNavigation("$page")
Back to Top
Photo Slideshow
The photo slideshow macro is a highly customizable tool to allow you to create Flash photo shows of any folder of images that you choose. It has several options which allow you to change the presentation of the slideshow. It is recommended that you put images for slideshows in their own folder inside an images directory, for ease of organization, for instance, /department/yourdept/images/slideshow1 .
Syntax: #psuSlideShow("$imageFolder")
Arguments:
$imageFolder : The path to the folder where the images for the slideshow are stored. Can be relative or absolute (recommended).
Optional Arguments:
$psuSSHeight : Sets the height of the player. Default: 300.
$psuSSWidth : Sets the width of the player. Default: 400.
$psuSSTransition : Sets the type of photo transition. Options are random (default), fade, bgfade, blocks, bubbles, circles, flash, fluids, lines or slowfade.
$psuSSAudio : Sets the location of an audio file to play with the slideshow.
$psuSSRotateTime : Integer sets the number of seconds an image is displayed for.
$psuSSShuffle : Playback images in a random order. Default: false.
Example: #psuSlideShow("/department/yourdept/images/gallery1")
Advanced Example: #set($psuSSHeight = "200") #set($psuSSWidth = "300") #set($psuSSTransition = "fade") #set($psuSSAudio = "/department/deptname/audio/slideshowCommentary.mp3") #psuSlideShow("/department/yourdept/images/gallery1")
Back to Top
Pull stories based on category
This creates a list of story links based on the category of the stories. It can be set to include all subcategories. It will build links based on a "Title - Sub-Title" format. If a sub-title is not detected, it will attempt to create a generic one based on the story type.
Syntax: \#pullStoriesByCategory("$categoryKey")
Arguments:
$categoryKey : The string value category key for the category (and its children) that you wish to display stories from. You may need to contact the CMS Administrator to get the key for a specific category. Note that a category key is not necessarily the same as its name.
Optional Arguments:
$ignoreChildren : Ignores all children categories and pulls only from the category specified. Default: false.
$numArticles : The maximum number of results to return. Default: 8.
Example: \#pullStoriesByCategory("col_art_science")
Advanced Example: #set($ignoreChildren = "true") #set($numArticles = "5") \#pullStoriesByCategory("col_technology")
Back to Top