Upload
hannonhill
View
236
Download
0
Tags:
Embed Size (px)
DESCRIPTION
This presentation will allow you to learn how to configure blocks to bundle up blocks to store site-specific information, index block to pick up site-specific information stored in Configuration blocks, create template-level formats to redistribute information to div elements, and convert XSLT library to process blocks
Citation preview
BLOCK CHOOSERS, CONFIGURATION BLOCKS, METADATA SETS, INDEXING, AND XSLT
Presented by
Wing Ming Chan, Sep 16, 2013
Upstate Medical University
1
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
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
THREE TYPES OF INFORMATION ON A PAGE
Global Site-specific Page-specific
4
GLOBAL INFORMATION
Global navigation Logo Search Breadcrumb Footer (partially)
5
SITE-SPECIFIC INFORMATION
Site title (text or image) Menu bar Left column Right column Footer contact
information Footer fourth
column
6
PAGE-SPECIFIC INFORMATION
DEFAULT Page-specific left/right columns Other regions in the center column
7
GLOBAL TEMPLATE (WITHOUT A LOT OF REGIONS)
8
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
CUSTOMIZABLE GLOBAL CONFIGURATIONS
Customizable regions for specific sites/pages The entire header replaceable Left column (one single region) Right column (one single region)
10
BLOCK CHOOSERS IN DEFAULT
Allowing blocks in DEFAULT Main reason: when switching content type,
only data in DEFAULT is kept
11
DATA DEFINITION FOR DEFAULT
12
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
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
CONFIGURATION BLOCK III
Four of them: _site-info _footer-contact _left-column _right-column
In Base Folder or any indexable sub-folders
15
_SITE-INFO
16
DATA DEFINITIONS OF CONFIGURATION BLOCKS
17
CONFIGURATION BLOCKS IN A SITE AND A FOLDER
18
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
INDEXING CONFIGURATION BLOCKS I
20
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 bricks21
FORMATTING THE INFORMATION
Using XSLT Configuration blocks are sorted using number
of ancestor folders in descending order Closest configuration block takes precedence
22
THE FORMAT
23
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
TEMPLATE FORMAT
25
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
GLOBAL METADATA SETS I
27
GLOBAL METADATA SETS II
28
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
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
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
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
BLOCK DATA DEFINITION
33
PROCESSING BLOCKS IN FORMATS
Named templates paired with blocks Hosting formats: switch-board code Call named templates in different hosting
formats
34
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
SWITCH-BOARD CODE
36
LIBRARY PROCESSING CODE
37
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
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
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
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
BRICKS II
42
BRICKS III
43
BRICKS IV
Adding code to site-block-indexing (used by STORAGE) so that the information is made available in STORAGE
44
BRICKS V
Adding a library file: bricks-processing
45
BRICKS VI
New code in template format:
46
BRICKS VII
A page with a brick:
47
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
BLICKS, BROCKS, OR BIW’S II
49
BLICKS, BROCKS, OR BIW’S III
50
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
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
SOLUTION II
Create the div element with the id in the format for DEFAULT
Assign appropriate classes to the div or wrapping div
53
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
INJECTING STYLE INTO HEAD AT PAGE LEVEL II
On the page:
The format for DEFAULT turns the p into a div:
55
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
INJECTING STYLE INTO HEAD AT PAGE LEVEL IV
57
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