This document discusses the use of configuration blocks, block choosers, indexing, and XSLT in Cascade CMS to provide flexible templating and customization across sites. Key points:
- Configuration blocks allow bundling of blocks for site-specific information, separating configuration from content formatting. Block choosers in DEFAULT allow reusable blocks.
- Indexing gathers information from configuration blocks to make it available globally via the STORAGE region. This includes both absolute and relative indexing.
- XSLT formats are used to process the indexed information and distribute it within templates and regions. Library templates in XSLT facilitate reusable code.
- Features like bricks, WYSIWYG blocks,
2. TOPICS
Objectives of the design
Template with no regions for site-specific
information
Configuration set vs. configuration block
Block choosers in DEFAULT and configuration
blocks
Indexing
XSLT formats
Formats for regions
Template format
Xalan component (if time allows)
Metadata sets 2
3. OBJECTIVES OF THE DESIGN
Avoid having too many site-specific components
and assets: templates, configuration sets, content
types, metadata sets, formats, index blocks
Separating the two functions of a configuration:
Controlling file format, output and publishing
Bundling blocks in regions for a site
Using blocks without regions
3
4. THREE TYPES OF INFORMATION
ON A PAGE
Global
Site-specific
Page-specific
4
6. SITE-SPECIFIC INFORMATION
Site title (text or image)
Menu bar
Left column
Right column
Footer contact
information
Footer fourth
column
6
9. CONFIGURATION VS.
CONFIGURATION BLOCK
Global configuration
Regions defined for global information and page-
specific information
Control file output, file extensions, publishing
No regions defined for site-specific information
Site-specific configuration blocks
Replace regions in configurations for sites
Block bundling
9
13. CONFIGURATION BLOCK I
A data definition block
Containing multiple block choosers and other UI
fields
Not plugged into any region (typical use)
Existing in and belonging to a specific site
To be indexed
Global index block
Global format processing the information gathered
and stored in STORAGE
13
14. CONFIGURATION BLOCK II
Containing site-specific/page-specific information
Site title
Menu bar
Theme
Local stylesheet
JavaScript library
Footer contact information
Blocks in left/right columns
14
15. CONFIGURATION BLOCK III
Four of them:
_site-info
_footer-contact
_left-column
_right-column
In Base Folder or any indexable sub-folders
15
19. TWO TYPES OF INDEXING
Absolute indexing
Tied with a folder
Belonging to a site
Block existing in a site, not reusable by other sites
Example: dropdown menu bar
Relative indexing
Starts from the calling page
Exists in global area
Block existing in _common, reusable by all sites
Examples: tabbed menu bar, breadcrumb, left menu
19
21. INDEXING CONFIGURATION
BLOCKS II
Relative indexing
The index block is plugged into a region named
STORAGE in the global configuration
Picking up information stored in the four
configuration blocks in a site
Blocks chosen: some global, some site-specific
(local)
Global: global menu bar, left menu, theme, global
bricks
Local: local menu bar, JavaScript, local stylesheet,
local bricks
21
22. FORMATTING THE INFORMATION
Using XSLT
Configuration blocks are sorted using number of
ancestor folders in descending order
Closest configuration block takes precedence
22
24. DISTRIBUTING INFORMATION IN
STORAGE
Template-level formats written in XSLT
Grab information from named div's and send it to
named div's
Clean up STORAGE
24
26. WHY THE STORAGE REGION AND
TEMPLATE-LEVEL FORMATS?
Global and local blocks made available to the entire site
Information made available to all regions on the page
Requires template-level formats
Moving information from a div in STORAGE to any div
on the page
Cleaning up all junks (STORAGE, unwanted div’s, etc.)
Applications
Bricks
Blocks in WYSIWYG’s
Injecting code into <head> at the page level
Wrapping up an entire newsletter in a block
26
29. OTHER USES OF CONFIGURATION
BLOCKS
Page-specific left/right column
Not to be indexed (hidden in non-indexable
folder)
Directly plugged into regions (LEFT COLUMN or
RIGHT COLUMN) at the page level
Used with formats
29
30. USES OF DATA DEFINITION BLOCKS
Four different ways of using a data definition
block (with respect to four different formats)
In a configuration block to be indexed
In a configuration block to be plugged into a region at
the page level (customizable configuration)
Plugged into a region at the page level, used with a
format
Chosen in a block chooser in DEFAULT
30
31. WHY XSLT?
Same processing code in four different formats
Centralized library code
Use call-template everywhere
Support of Xalan components if programming
logic needed
Use of template-level formats
As of Cascade 7.6, Velocity code library is
possible; what about template-level format?
31
32. IDENTIFYING BLOCKS
INSIDE CONFIGURATION BLOCKS
Each block has a unique identifier
Text blocks: unique names
Data definition blocks: hidden type identifiers
Index blocks: unique names
32
34. PROCESSING BLOCKS IN FORMATS
Named templates paired with blocks
Hosting formats: switch-board code
Call named templates in different hosting
formats
34
35. XSLT LIBRARIES
Named templates in library files
Namespaces
Using XPath with names and attributes
Using context nodes
Where named templates are used
In DEFAULT format
In the STORAGE region
In customized left/right column regions
In other regions in center column
35
38. TRICKS ABOUT CONTEXT NODE I
The parent node of system-data-structure is
content
By selecting content when calling apply-
templates, the content node is passed in as the
context node
38
39. TRICKS ABOUT CONTEXT NODE II
Within the context, system-data-structure can be
referred to directly
In left-right-column-processing, the template
that matches system-data-structure just sits
there, waiting to be used
There are no calls to templates that match bare
system-data-structure
This eliminates accidental matching of system-
data-structure somewhere in the library
Whenever a match of system-data-structure is
needed, prefix it with an XPath
39
40. KNOWN ISSUES RELATED TO
INDEXING
Cyclic indexing
At one point, blocks were used to generate items in
left menu
Index block left-menu indexing pages, folders,
references, external links, and blocks (including
configuration blocks)
Configuration block _left-column contains left-menu
Index cache
Menu highlighting not updated instantly
40
41. BRICKS I
Bricks blocks: data definition blocks, which can
be either global or site-specific
Chosen in _site-info
Information available in STORAGE, no special
treatment needed
String replacement in template format
Brick values available anywhere on a page
(DEFAULT, right column, left column, header,
footer, etc.)
41
48. BLICKS, BROCKS, OR BIW’S I
A block that can be inserted into a WYSIWYG
Something between a brick and a block
Block choosers in _site-info, all assigned a fixed
set of id’s
Block info made available in STORAGE
In WYSIWYG, insert div’s with matching id’s
Template formats distribute info in STORAGE to
these div’s
48
51. PROBLEM
The div element is invisible in the WYSIWYG
Dummy content can be added to the div (a string
or an image); the content will be removed by the
template formats
51
52. SOLUTION I
An id can be entered directly into the WYSIWYG,
wrapped by <p></p> tags
Assign a pre-defined class to the p element
52
53. SOLUTION II
Create the div element with the id in the format
for DEFAULT
Assign appropriate classes to the div or wrapping
div
53
54. INJECTING STYLE
INTO HEAD AT PAGE LEVEL I
Add a div (id=“show-page-style”) in <head> in the
template
Choose a block containing style information in
_site-info
54
55. INJECTING STYLE
INTO HEAD AT PAGE LEVEL II
On the page:
The format for DEFAULT turns the p into a div:
55
56. INJECTING STYLE
INTO HEAD AT PAGE LEVEL III
The template formats match the page name in
the block and the page name on the page, and
inserts the style rules into <head>
56
58. USING STORAGE:
THE LOGICAL CONCLUSION
There is no reason why the region STORAGE cannot
be associated with a mega block, containing multiple
block choosers
site-block-indexing can be just one of the blocks
available to STORAGE
Global blocks can also be chosen by the mega block;
then global blocks can be replaced at site level (no
difference between global and local any more)
Besides DEFAULT, there will be only one region,
namely STORAGE, in an entire template
Only XSLT formats make sense in this setup, unless
we are ready for a huge Velocity format
58