Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I’m Excited
Joel Bair (purlHub Specialist) March 14, 2014 23:02

Quick Update - 2 new features

Just a quick update to 2 new utility features.

Show and Hide support.

purlHub's JSAPI v1.5.x has continual improvement since its release.   Recently, we've added some builtin toggles for showing and hiding content.  

A common use case is showing custom content to pURL visitors and general content to anonymous visitors.  This is supported by 2 new generic CSS class flags; phProfileShow and phProfileHide.  Any element that has the class phProfileShow class will be hidden to anonymous visitors and displayed only to pURL visitors (visits where a valid pURL profile exists).  Inversely, the phProfileHide class will cause the element to be hidden in the presence of a pURL, and only displayed to anonymous visitors.

Additionally - for more advanced support, we've added phRecordShow- and phRecordHide- class flag prefixes for toggling element display only under the presence of named profile records.  I.e. phRecordShow-registration would only show the element if the profile contained a "registration" record.  This is reciprocated by phRecordHide-registration

As usual,  the user has total control over these flag names and prefixes.  New JSAPI options and their defaults are as follows:
profileShowClass: 'phProfileShow', // default
profileHideClass: 'phProfileHide', // default

recordShowClassPrefix: 'phRecordShow' // followed by - or _ and the record name
recordHideClassPrefix: 'phRecordHide' // followed by - or _ and the record name