Dynamic Scripts
Easily create dynamic content within your enterprise without knowing code
The Dynamic Scripts module allows administrators to pull records from individual modules and display that data in list or columnar format on the front end of the site. See Figure 1 and Figure 2 below.
Title 1
Date 1 (if displayed)
Content Field 1 (if displayed)
Title 2
Date 2 (if displayed)
Content Field 2 (if displayed)
Title 3
Date 3 (if displayed)
Content Field 3 (if displayed)
Figure 1
| Title 1
Date 1 (if displayed)
Content Field 1 (if displayed) |
Title 4
Date 4 (if displayed)
Content Field 4 (if displayed) |
| Title 2
Date 2 (if displayed)
Content Field 2 (if displayed) |
Title 5
Date 5 (if displayed)
Content Field 5 (if displayed) |
| Title 3
Date 3 (if displayed)
Content Field 3 (if displayed) |
Title 6
Date 6 (if displayed)
Content Field 6 (if displayed) |
Figure 2
Placing the dynamic script in any RTF editor that supports Cp scripting allows administrators to control the look and feel -- and output display -- of their content, as well as increase access to module records.
Dynamic Scripts is located under the "Design" tab within CentralPoint's administrative console. The module features three tabs: Details, Fields and Formatting.
Administrators can format the output of their records using Cascading Style Sheets (CSS), as well as determine which fields display as part of their output list.
The system allows administrators to pull records dynamically by Taxonomy or manually by employing a custom SQL "where" clause. Additionally, administrators can order their output lists by one of CentralPoint's pre-defined fields, or they can enter their own "order by" clause.
Finally, the script that administrators place on the front end of the site will generate valid HTML, allowing search engines to easily follow links.
(Administrators of CentralPoint ME2 recognize this functionality from the Design > Script Generator module.)
Chapters
Details Tab
Fields Tab
Formatting Tab
Placing a Script
Details Tab
The Details tab requires administrators to define the name of the script and the module from which the script will pull records. Other fields are optional, but in order to create a valid script a title and module must be defined.
The title of the script is used for console display only, although the name of the script will appear within an HTML comment on the front end of a web site immediately before the script's output.
Publish Start Date and Publish End Date allow administrators to define when the script will be valid for output purposes. As long as today's date falls between the Start Data and End Date range, the script will display output.
The system uses the CpScript field to generate the script that administrators will place within the console to deliver their dynamic content. Administrator input is not required, though after a script is created (saved), administrators can use the "copy" button adjacent to the CpScript field to copy the script for placement.
The Cache Duration field instructs the system on how often to look for new data related to the script to display it on the front end. The default is set to 1 day, although administrators can choose from among the following options:
No Cache
1 Minute
5 Minutes
15 Minutes
30 Minutes
1 Hour
4 Hours
8 Hours
12 Hours
1 Day
1 Week
Setting at least some cache will improve the performance of the script, and the web site as a whole. Generally speaking, if an administrator's organization is producing content on a daily basis, setting a cache of between 4 Hours and 1 Day is good practice.
Choose the module from which your script will pull data in the Module radio-button list. This field is fully searchable using the "Search" field, as well as the "Match" and "In" drop-downs.
The Filter Type option allows administrators to query the module with either a custom SQL filter (choose "Manual") or a system-aided script (Choose "Dynamic"). "Dynamic" will work for the majority of scripts administrators create. Choosing "Dynamic" requires administrators to filter the module's content with the "Taxonomy" field.
Choosing one or more taxonomies from the "Taxonomy" field allows administrators to filter easily which records they wish to display. Choosing one taxonomy will tell the system to deliver the records that are tied to that taxonomy; choosing more than one taxonomy tells the system to display records that are tied to those taxonomies chosen.
For instance, if an administrator wants to display Articles that are tied to Taxonomy A, Taxonomy F and Taxonomy K. The administrator should choose those taxonomies from the Taxonomy multi-select field only, and the system will display records that are tied to all three taxonomies.
Administrators choosing the "Manual" option will have access to a "WHERE clause" field in which they can insert valid where-type clauses. Administrators should use the "Manual" filter only when they demonstrate a firm grasp of the fields (and their data types) available in each module and competency in SQL. Choosing "Manual” The common syntax for the Manual filter field follows closely that of a standard "where" clause in SQL. As an example, this "manual" filter looks for records whose taxonomy matches a specific ID:
(Taxonomy like '%086b607d-bac4-45cd-8600-06c877489f7b%')
The Archive Type field determines which type of records the script will display. The options are: All Current, Expired, Future and Published.
"All Current" will display any record whether it is on hold or released, hidden or visible.
"Expired" will display all records whose Publish End Date is past.
"Future" displays those records whose Publish Start Date has not yet come.
"Published" displays records that are "released" and "visible" only.
The "Organizational Filter" options of "Automatic" and "Specify" give administrators further control over the records that display in their scripts. The "Audience Filtration" and "Role Filtration" attributes are used in conjunction with the "Automatic" option.
Choosing "Automatic" -- along with "Yes" for "Audience Filtration" and "Role Filtration" -- will display records tied to the audience and role a user is on when he or she views the content on the front end of the site. For instance, if user views the contents of a script while browsing in /AudienceA/RoleF/, the script will display content that is tied to that audience and that role only.
Choosing "No" for "Audience Filtration" and "Role Filtration" will allow any records from within the module to display, regardless of where a user browses.
To maintain greater control over the records that display within the script, choose "Specify" as the "Organizational Filter" value. Choosing "Specify" displays an "Audience" and "Role" drop-down menus from which administrators are required to define their desired values. Note that the audience drop-down menu displays relevant children of an audience when a parent is chosen.
The "Record Count" field allows administrators to display up to 999 records from a module in list or columnar format.
The "Record Skip Count" field -- in conjunction with the "Record Count" field -- allows administrators to display the "[Record Count] - [Record Skip Count]" records from a given query, where [Record Skip Count] is a number less than the number assigned in the Record Count field. For example, if the "Record Count" field is 10 and the "Record Skip" field is 6, the script will display five records -- in this case, records 7 through 10 -- of that 10-record list. This is particularly useful on pages that contain multiple scripts displaying similar content.
"Record Order" works in conjunction with the "Predefined Order" drop-down if administrators choose the "Predefined" value. This functionality allows administrators to display their lists in a desired order. Available predefined order options include:
Date Ascending (Oldest on top, newest on the bottom)
Date Descending (Newest on top, oldest on the bottom)
Highest Rated (highest rated on top)
Most Viewed (most viewed on top)
Random (completely random display of records)
Title Ascending (A on top, Z on the bottom)
Title Descending (Z on top, A on the bottom)
Choosing "Custom" allows administrators to define their own "Custom Order" clause. Administrators should use the "Custom" filter only when they demonstrate a firm grasp of the fields (and their data types) available in each module and competency in SQL. As an example, this "Custom order" filter will order the records by Field1, ascending:
Field1 ASC
The "Audiences" multi-select is for console use only. Administrators can choose relevant audiences to filter which administrators have access to which scripts.
The "Display Status" determines whether or not the contents of the dynamic script are displayed on the front end of the web site.
Formatting Options
- Standard:
This is a basic representation of the Standard option. The other tabs define exactly how this will look.
- Content Pager:
This is a basic represenation of the Content Pager option. There are new attributes to choose from when creating this:
- Next Button:
This will show an image for the next button. This will only apply if both Next Button and Previous Button image are uploaded.
- Next Link Label:
This will show the Next Text if an image is not selected. It is Next by default.
- Previous Button:
This will show an image for the previous button. This will only apply if both Next Button and Previous Button image are uploaded.
- Previous Link Label:
This will show the Previous Text if an image is not selected. It is Previous by default.
- Reveal Type:
This has two option. Click will make the selected page change when you click the mouse. Mouseover will make the selected page change when you hover over a page number.
- Enable Fade Transition:
This will enable a Fade Transition to the pager when new items are selected.
- Auto Rotate:
This will rotate the contents automatically.
- Rotation Pause Time:
This is the pause time for the Auto Rotate option. This is the time will take before the content is rotated.
- Rotation Pause Time:
This is the pause time for the Auto Rotate option. This is the time will take before the content is rotated.
- Define Slide Background Image Field:
This will put a background image to the content based on a field in the module.
- Wrapper DIV CSS:
This is the Styles for the wrapper of the content pager.
- Slide DIV CSS:
This is the Styles for each individual slide for the content.
- Pagination CSS:
This is the Styles for the pagination at the bottom of the content pager.
- Z Index Auto Increment:
If you are experience issues with the content pager showing on top of other content, set this option to no.
- Image Slideshow
This is the basic representation of the Image Slideshow option. Here are the additional fields to change the functionality:
- Slideshow Width:
This is the entire slideshow width in pixels.
- Slideshow Background Color:
This is the background color for the entire slideshow.
- Slideshow Padding Top:
This is the padding top for the entire slideshow.
- Slideshow Padding Bottom:
This is the padding bottom for the entire slideshow.
- Slideshow Padding Left:
This is the padding left for the entire slideshow.
- Slideshow Padding Right:
This is the padding right for the entire slideshow.
- Main Gallery Height:
This is the main gallery region height.
- Main Gallery Padding Top:
This is the main gallery region padding top.
- Main Gallery Padding Bottom:
This is the main gallery region padding bottom.
- Display Main Gallery Previous / Next Images:
This will show the Left and Right Main Image Gallery Images.
- Main Gallery Left Arrow:
This is the image for the left arrow of the gallery. It will have a default image if none is selected.
- Main Gallery Right Arrow:
This is the image for the right arrow of the gallery. It will have a default image if none is selected.
- Caption Background Color:
The caption is made from the Define Title Field and Define Content Field 1 columns. This is the background color for the gallery caption popup.
- Caption Text Color:
This is the text color for the gallery caption popup.
- Caption Opacity:
This is the opacity of the caption.
- Thumbnail Height:
This is the height of the thumbnail. The width will automatically be generated.
- Thumbnail Opacity:
This will set the opacity for the thumbnails.
- Thumbnail Padding Top:
This is the padding top for the Thumbnails region.
- Thumbnail Padding Bottom:
This is the padding bottom for the thumbnail region.
- Display Thumbnail Previous / Next Images:
This will display the thumbnail previous and next images.
- Link Thumbnail To Record:
This will link the Thumbnails to the record displayed. This should only be used when Hide Main Gallery is set to Yes.
- Thumbnail Tooltip:
This will show a tooltip for the Thumbnail based on a column.
- Thumbnail Tooltip Column Name:
This is the Column name for the Thumbnail Tooltip contents.
- Navigation Bar Text Color:
This is the text color for the image count and the start and stop links (the Navigation Bar).
- Navigation Padding Top:
This is the padding top for the Navigation bar.
- Navigation Padding Bottom:
This is the padding bottom for the Navigation bar.
- Navigation Padding Left:
This is the padding left for the Navigation Bar.
- Navigation Padding Right:
This is the padding right for the Navigation Bar.
- Auto Start:
This will start the slideshow automatically.
- Slide Show Effect:
This is the effect for the slide show.
- Animation Speed:
This is the speed of the animation effect.
- Auto Play Duration:
This is the time in which images switch when the slide show is running.
- Hide Navigation Bar:
This will hide the image numbers and the start stop links.
- Hide Thumbnails:
This will hide the thumbnails from the slideshow.
- Hide Main Gallery:
This will hide the main image part of the slideshow.
Fields Tab
The Fields tab determines what your script will display, including whether or not the title of the record will display, the date will display (and if so, what format) and if the script will display an image for each record.
The first attribute administrators must decide on is "Display Title Field". The majority of scripts display this field, and the corresponding link to the record, so the default is set to "Show". Showing the title field requires the administrator to define the title field, which is "Title" by default.
Administrators that wish to display lists of content that do not link to records should choose "Hide".
If the script displays the "Title" field, administrators can control the design of that field and its corresponding link with the "Title Field CSS". Administrators have complete control over the contents of this field -- except the names of the CSS classes. dsTitleField must remain as the class name or the design defined in the CSS will not function properly.
Next, administrators can define the data field in the "Define Date Field" attribute. If the script should not display the date, choose the "Hide" option in the "Display Date Field" attribute.
"StartDate" is the default date that displays with each script, but administrators can choose other valid date fields from a particular module should they desire. Keep in mind, however, that the value of the "Define Date Field" must be a valid date field or the system will not display it.
Administrators that wish to display the date field can control the date display in two ways: the date format itself (using the "Date Format" field) and the font format (using the Date Field CSS).
There are several date format options from which to choose. Clicking the "Date Format" text within the module will pop up a window that displays all of the options. They are listed below, as well.
| Standard Formats |
| Display Example |
Format Code (Case Sensitive) |
| 3/9/2008 |
d |
| 4:05:07 PM |
T |
| Sunday, March 09, 2008 |
D |
| Sunday, March 09, 2008 4:05 PM |
f |
| Sunday, March 09, 2008 4:05:07 PM |
F |
| Sun, 09 Mar 2008 16:05:07 GMT |
r |
| 3/9/2008 4:05 PM |
g |
| 3/9/2008 4:05:07 PM |
G |
| March 09 |
m |
| March, 2008 |
y |
| 2008-03-09T16:05:07 |
s |
| 2008-03-09 16:05:07Z |
u |
| |
| Custom Formats |
| Display Example |
Format Code (Case Sensitive) |
| 3/9/2008 |
M/d/yyyy |
| 03/09/2008 |
MM/dd/yyyy |
| Sun, Mar 9, 2008 |
ddd, MMM d, yyyy |
| Sunday, March 9, 2008 |
dddd, MMMM d, yyyy |
| 03/09/08 |
MM/dd/yy |
| 03/09/2008 |
MM/dd/yyyy |
To employ a standard format, type the letter of the code in the "Date Format" field. This code is case-sensitive.
To employ a custom format, enter into the "Date Format" field the format of the date as it appears above.
The "Number of Content Fields" option allows administrators to extend the amount of information that displays with each record. The default is "One", but administrators can display up to three fields, in addition to date and title.
Typical usage of more than one content field is when administrators wish to display product catalog items or calendar of event records.
Each content field allows administrators to define the field they wish to display, control the display of that field using CSS (Content Field [n] CSS), determine whether or not the field display is truncated (Content Field [n] Truncation) and determine whether or not the system removes HTML formatting from the display of that field (Content Field [n] Retain HTML).
To determine the content field ("Define Content Field [n]"), enter the exact name of the field from the module. If you wish to display no additional fields, leave the "Define Content Field 1" field empty.
Administrators can control the design of the content [n] field by altering the "Content Field [n] CSS". Please note that the class name defined in the CSS -- .dsContentField[n] -- must remain intact for the formatting to take effect.
To limit the number of characters that display from the content field, enter a number up to 999 in the "Content Field [n] Truncation" field.
Administrators can also strip HTML formatting from the content field by setting the "Content Field [n] Retain HTML" attribute to "No". The advantage of stripping HTML formatting is if your content field contains many < Div > or < Table > references. Stripping the HTML content will return plain text that will inherit the formatting assigned in the "Content Field [n] CSS" field.
Maintaining HTML formatting -- setting Content Field [n] Retain HTML to "Yes" -- will return HTML and text. Take note that truncating HTML may adversely affect the design of your site.
Administrators can display an image adjacent to or on top of every record that appears in the dynamically generated content list by inserting the name of the image field from the module into the "Define Image Field" attribute. If the module from which the content is coming contains no image filed, leave the image field blank and move on to the "Formatting" tab.
The attributes "Image HSpace," "Image VSpace", Image Height", "Image Width" and "Image Display Position" define the location and appearance of the image that will appear in each record.
"Image HSpace" defines the horizontal margin (in pixels) around the image.
"Image VSpace" defines the vertical margin (in pixels) around the image.
To proportionally size the image using the height attribute, insert a height (in pixels) into the "Image Height" field, and leave the "Image Width" field blank. All images will appear at that height and width.
To proportionally size the image using the width attribute, insert a width (in pixels) into the "Image Width" field, and leave the "Image Height" field blank. All images will appear at that width and height.
Administrators can also leave both image width and height blank to display the image at its real, uploaded size.
Finally, the "Image Display Position" determines where, relative to the content, the image will display. The options include:
Content Left (inline, aligned to the left of the content)
Content Right (inline, align to the right of the content)
Top Left (on top of each record, aligned left)
Top Center (on top of each record, aligned center)
Top Right (on top of each record, aligned right)
Formatting Tab
The "Formatting" Tab allows administrators to further define the look and feel of their scripts, determining the orientation of the list or columnar display, the record alignment, and a custom "no data to display" message, among other options.
The "Repeat Columns" and "Repeat Direction" attributes work in tandem to display the list. The default "Repeat Columns" value is "1" and the default "Repeat Direction" value is "Vertical". These two settings will display records in this orientation:
Title 1
Date 1 (if displayed)
Content Field 1 (if displayed)
Title 2
Date 2 (if displayed)
Content Field 2 (if displayed)
Title 3
Date 3 (if displayed)
Content Field 3 (if displayed)
Assigning a value greater than one to the "Repeat Columns" attribute will allow administrators to display records adjacent to each other. For example, entering "2" in the "Repeat Columns" attribute and choosing "Vertical" as the "Repeat Direction" option will display six records in this orientation:
| Title 1
Date 1 (if displayed)
Content Field 1 (if displayed) |
Title 4
Date 4 (if displayed)
Content Field 4 (if displayed) |
| Title 2
Date 2 (if displayed)
Content Field 2 (if displayed) |
Title 5
Date 5 (if displayed)
Content Field 5 (if displayed) |
| Title 3
Date 3 (if displayed)
Content Field 3 (if displayed) |
Title 6
Date 6 (if displayed)
Content Field 6 (if displayed) |
Choosing "Horizontal" as the "Repeat Direction" value will display six records in this orientation:
| Title 1
Date 1 (if displayed)
Content Field 1 (if displayed) |
Title 2
Date 2 (if displayed)
Content Field 2 (if displayed) |
| Title 3
Date 3 (if displayed)
Content Field 3 (if displayed) |
Title 4
Date 4 (if displayed)
Content Field 4 (if displayed) |
| Title 5
Date 5 (if displayed)
Content Field 5 (if displayed) |
Title 6
Date 6 (if displayed)
Content Field 6 (
 |
Loading... |
|