SlideShare ist ein Scribd-Unternehmen logo
1 von 41
In Pursuit of the Grand Unified 
Template 
or 
Page Level Formats 
Jason Aller 
UC Davis School of Law 
#csuc14, @JasonAller
Who am I? 
• Cascade Server Admin and Developer 
• This is my seventh Users Conference 
• I make things like: 
– The Cascade Entity Relationship Diagram 
– grunt-cascade-deploy on github 
– soap-cascade on github
A thanks to the folks at Tarleton 
As the manager of www.tarleton.edu, Web Services 
reserves the right to edit any Tarleton webpage at 
any time in order to make corrections and 
improvements to items such as misspellings, poor 
content structure, accessibility issues, copyright 
issues, security issues, and outdated information. 
Web Services may not contact the content owner 
in advance but will make an effort to communicate 
the changes and issues soon after they are made.
Overview 
I’m going to be using XSLT for my examples, 
though I did buy “Velocity: The Basics” by James 
Johnson 
• Changing Links 
• Conditional Restructuring - Bootstrap 
• Exposing additional data at the page level
Conditional Restructuring 
• Bootstrap – but can be used with many other 
CSS frameworks 
• One design with multiple layouts 
• From a single template 
• Let the system do all the work automatically 
• Because automating the CMS is more effective 
than training content contributors
The page as XML source
XSLT Default Templates 
• Traverse Elements 
<xsl:template match="*|/"> 
<xsl:apply-templates/> 
</xsl:template> 
• Process content and attributes 
<xsl:template match="text()|@*"> 
<xsl:value-of select="."/> 
</xsl:template> 
• Remove comments and processing instructions 
<xsl:template match="processing-instruction()| 
comment()"/>
Changing Links 
• Find with XPath 
– <a… 
– <a href="http… 
– <a href="mailto:… 
• Process the element (copy, modify, remove) 
• Unless removing, send that element’s content 
to be processed – recurse
Changing Links 
• Add Google Tracking to outgoing links 
• Append a non-breaking space and an icon 
after the link for links to PDF and PowerPoint 
files
Link code 
<xsl:template match="node()[name() = 'a']"> 
<!-- begin copying the source node --> 
<xsl:copy> 
<!-- If we might want to track this with Google: --> 
<xsl:if test="starts-with(@href,'http')"> 
<xsl:choose> 
<!-- Check if there is already an onClick event and add ours --> 
<xsl:when test="@onClick"> 
<xsl:attribute name="onClick"> 
<xsl:value-of select="concat(@onClick,' ')"/> 
<xsl:call-template name="pageTracker"/> 
</xsl:attribute> 
</xsl:when> 
<!-- of if there wasn't an onClick event add one --> 
<xsl:otherwise> 
<xsl:attribute name="onClick"> 
<xsl:call-template name="pageTracker"/> 
</xsl:attribute> 
</xsl:otherwise> 
</xsl:choose> 
</xsl:if>
Link code cont. 
<!-- process non-onClick attributes and child nodes --> 
<xsl:apply-templates select="@*[name() != 'onClick']|node()"/> 
<!-- figure out if we need to add docIcons --> 
<xsl:choose> 
<xsl:when test="child::node()[name() = 'img']"> 
<!-- Do nothing, because link is wrapped around graphic --> 
</xsl:when> 
<xsl:when test="substring(@href,string-length(@href)-3,4) = '.pdf'"> 
<xsl:text>&#160;</xsl:text> 
<span class="sprite pdf-n"></span> 
</xsl:when> 
<xsl:when test="substring(@href,string-length(@href)-3,4) = '.ppt' or 
substring(@href,string-length(@href)-4,5) = '.pptx'"> 
<xsl:text>&#160;</xsl:text> 
<span class="sprite ppt-n"></span> 
</xsl:when> 
<xsl:otherwise/> 
</xsl:choose> 
</xsl:copy> 
</xsl:template>
pageTracker 
<xsl:template name="pageTracker"> 
<xsl:text>javascript:pageTracker.</xsl:text> 
<xsl:text>_trackPageview('</xsl:text> 
<xsl:value-of select="$pagePath"/> 
<xsl:text>/outgoing/</xsl:text> 
<xsl:value-of select="translate(., $singleQuote, '')"/> 
<xsl:text>/</xsl:text> 
<xsl:value-of select="substring-after 
(@href,'http://')"/> 
<xsl:text>');</xsl:text> 
</xsl:template> 
/current/portal/outgoing/Intranet/intranet.law.ucdavis.edu/index.aspx
Conditional Restructuring 
• Determine rules 
– Decide the logic once, then apply it 
• Output alternative wrapper elements 
• Process content – recurse 
• It’s turtles all the way down
navmidbar(2) 
2 8 2 
navmidbar(3) 
2 7 3 
navmid 
2 10 
midbar(2) 
10 2 
midbar(3) 
9 3 
mid 
12 
home 
4 5 3 
Phone
home 
4 5 3
navmidbar(3) 
2 7 3
navmid 
2 10
mid 
12
midbar(2) 
10 2
Bootstrap 
Bootstrap is based on 12 columns and wants 
<div class="col-sm-3"> 
or 
<div class="col-sm-2"> 
We want to have a single template to maintain that 
can allow three columns with the following options: 
• Left – either 2 or 0 
• Main – either 7, 8, 9, 10, or 12 – fills space 
• Right – either 0, 2, or 3
One Template 
<div id="zeroth"> 
<div class="row"> 
<div id="first"> 
<system-region name="SUBNAV"/> 
<system-region name="QUICKLINKS"/> 
</div> 
<div id="second"> 
<system-region name="CONTENT-TITLE"/> 
<system-region name="DEFAULT-PRE"/> 
<system-region name="DEFAULT"/> 
<system-region name="DEFAULT-POST"/> 
</div> 
<div id="third"> 
<system-region name="SIDEBAR-TOP"/> 
<system-region name=“SIDEBAR"/> 
<system-region name="SIDEBAR-BOTTOM"/> 
</div> 
</div> 
</div>
Pseudocode Tour 
• Check for content in each area 
• Pick a layout based on this 
• For each area apply the rules of that layout 
– zeroth 
– first 
– second 
– third
Checking for <div> Content 
<xsl:variable name="con1" 
select="count( 
//node() 
[name()='div'] 
[@id='first'] 
/*[not( 
name() = 'img' and 
substring(@src,1,10) = 
'/css/icons')])"/>
Layout Assignment Logic 
<xsl:variable name="layout"> 
<xsl:choose> 
<xsl:when test="$pagePath 
= '/index'"> 
<xsl:text>home</xsl:text> 
</xsl:when> 
<xsl:when test="$con1 = 0 and 
not($con2 = 0) and 
$con3 = 0"> 
<xsl:text>mid</xsl:text> 
</xsl:when> 
home 
4 5 3 
mid 
12
Layout cont. 
<xsl:when test="not($con1 = 0) and 
not($con2 = 0) and $con3 = 0"> 
<xsl:text>navmid</xsl:text> 
</xsl:when> 
<xsl:when test="not($con1 = 0) and 
not($con2 = 0) and not($con3 = 0)"> 
<xsl:text>navmidbar</xsl:text> 
</xsl:when> 
<xsl:when test="$con1 = 0 and 
not($con2 = 0) and not($con3 = 0)"> 
<xsl:text>midbar</xsl:text> 
</xsl:when> 
navmid 
2 10 
navmidbar(2) 
2 8 2 
midbar(2) 
10 2
Layout cont. 
<xsl:otherwise> 
<xsl:text>default</xsl:text> 
</xsl:otherwise> 
</xsl:choose> 
</xsl:variable>
zeroth 
<xsl:template match="node()[name()='div'][@id='zeroth']"> 
<xsl:choose> 
<xsl:when test="$layout = 'home'"> 
<div class="container" id="content"> 
<xsl:apply-templates select="node()"/> 
</div> 
</xsl:when> 
<xsl:otherwise> 
<div class="container"> 
<xsl:apply-templates select="node()"/> 
</div> 
</xsl:otherwise> 
</xsl:choose> 
</xsl:template>
first 
<xsl:template match="node() 
[name()='div'][@id='first']"> 
<xsl:choose> 
<xsl:when test="$layout = 'home'"> 
<div class="col-md-3 col-md-push-9"> 
<xsl:apply-templates /> 
</div> 
</xsl:when> 
home 
4 5 3
first cont. 
<xsl:when test="$layout = 'navmid' 
or $layout = 'navmidbar'"> 
<div class="col-sm-2"> 
<xsl:if test="./div[@id = 'subNav'] or ./div[@id = 
'relatedLinks'] or ./div[@class = 'left-column-full- 
width']"> 
<xsl:attribute name="class"> 
<xsl:text>col-sm-2 left-column</xsl:text> 
</xsl:attribute> 
</xsl:if> 
<xsl:apply-templates /> 
</div> 
</xsl:when> 
navmidbar(2) 
2 8 2
first cont. 
<xsl:otherwise/> 
</xsl:choose> 
</xsl:template> 
midbar(2) 
10 2 
midbar(3) 
9 3 
mid 
12
second 
<xsl:template match="node() 
[name()='div'][@id='second']"> 
<xsl:choose> 
<xsl:when test="$layout = 'home'"> 
<div class="col-md-4 col-md-pull-3"> 
<xsl:apply-templates select="node()"/> 
</div> 
</xsl:when> 
<xsl:when test="$layout = 'mid'"> 
<div class="col-sm-12" id="content"> 
<xsl:apply-templates select="node()"/> 
</div> 
</xsl:when> 
mid 
12 
home 
4 5 3
second cont. 
<xsl:when test="$layout = 'navmid'"> 
<div class="col-sm-10" id="content"> 
<xsl:apply-templates select="node()"/> 
</div> 
</xsl:when> 
<xsl:when test="$layout = 'midbar'"> 
<div id="content"> 
<xsl:attribute name="class"> 
<xsl:choose> 
<xsl:when test="$sidebar = '3'"> 
<xsl:text>col-sm-9</xsl:text> 
</xsl:when> 
<xsl:otherwise> 
<xsl:text>col-sm-10</xsl:text> 
</xsl:otherwise> 
</xsl:choose> 
</xsl:attribute> 
<xsl:apply-templates select="node()"/> 
</div> 
</xsl:when> 
navmid 
2 10 
midbar(3) 
9 3 
midbar(2) 
10 2
second cont. 
<xsl:otherwise> 
<div id="content"> 
<xsl:attribute name="class"> 
<xsl:choose> 
<xsl:when test="$sidebar = '3'"> 
<xsl:text>col-sm-7</xsl:text> 
</xsl:when> 
<xsl:otherwise> 
<xsl:text>col-sm-8</xsl:text> 
</xsl:otherwise> 
</xsl:choose> 
</xsl:attribute> 
<xsl:apply-templates /> 
</div> 
</xsl:otherwise> 
</xsl:choose> 
</xsl:template> 
navmidbar(2) 
2 8 2 
navmidbar(3) 
2 7 3
third 
<xsl:template match="node() 
[name()='div'][@id='third']"> 
<xsl:choose> 
<xsl:when test="$layout = 'home'"> 
<div class="col-md-5 col-md-pull-3"> 
<xsl:apply-templates /> 
</div> 
</xsl:when> home 
4 5 3
third cont. 
<xsl:when test="$layout = 'navmidbar' or $layout = 'midbar'"> 
<div id="right-column"> 
<xsl:attribute name="class"> 
<xsl:choose> 
<xsl:when test="$sidebar = '3'"> 
<xsl:text>col-sm-3</xsl:text> 
</xsl:when> 
<xsl:otherwise> 
<xsl:text>col-sm-2</xsl:text> 
</xsl:otherwise> 
</xsl:choose> 
</xsl:attribute> 
<xsl:apply-templates /> 
</div> 
</xsl:when> 
midbar(3) 
9 3 
midbar(2) 
10 2
third cont. 
<xsl:otherwise/> 
</xsl:choose> 
</xsl:template>
Exposing metadata at the page level 
• Expose at template level 
• Extract values to variables 
• Add rule to remove – swallow it with the 
format
Insert 
• <system-region name="CASCADE-METADATA"/> 
• Index block self-metadata 
• <xsl:template match="/"> 
<xsl:copy-of select="/"/> 
</xsl:template>
Extract 
Pull the page path out: 
• <xsl:variable name="pagePath" 
select="//calling-page/system-page/path"/> 
Pull page metadata: 
• <xsl:variable name="sidebar" 
select="//calling-page/system-page/dynamic-metadata[ 
name = 'sidebar']/value"/> 
Swallow the data to prevent publishing it: 
• <xsl:template match="node()[name() = 'system-index- 
block']"/>
Future plans 
• RFC3966 tel: URI 
• Not <blockquote> from <p> with “” 
– I’ll write my own replacement for TinyMCE before 
I do that! With Cascade 8 I won’t have to! 
• Use [system-view:internal] and [system-view: 
external] to highlight violations of the 
style guide 
• Take a vacation

Weitere ähnliche Inhalte

Was ist angesagt?

Modularity and Layered Data Model
Modularity and Layered Data ModelModularity and Layered Data Model
Modularity and Layered Data ModelAttila Jenei
 
Intro To jQuery In Drupal
Intro To jQuery In DrupalIntro To jQuery In Drupal
Intro To jQuery In DrupalMatthew Farina
 
BITS: Introduction to relational databases and MySQL - Schema design
BITS: Introduction to relational databases and MySQL - Schema designBITS: Introduction to relational databases and MySQL - Schema design
BITS: Introduction to relational databases and MySQL - Schema designBITS
 
JavaScript for Flex Devs
JavaScript for Flex DevsJavaScript for Flex Devs
JavaScript for Flex DevsAaronius
 
Client-side MVC with Backbone.js
Client-side MVC with Backbone.js Client-side MVC with Backbone.js
Client-side MVC with Backbone.js iloveigloo
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
Railswaycon Inside Matz Ruby
Railswaycon Inside Matz RubyRailswaycon Inside Matz Ruby
Railswaycon Inside Matz RubyLourens Naudé
 
MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!Roberto Messora
 
Organizing Code with JavascriptMVC
Organizing Code with JavascriptMVCOrganizing Code with JavascriptMVC
Organizing Code with JavascriptMVCThomas Reynolds
 
Simpler Core Data with RubyMotion
Simpler Core Data with RubyMotionSimpler Core Data with RubyMotion
Simpler Core Data with RubyMotionStefan Haflidason
 
WebApps e Frameworks Javascript
WebApps e Frameworks JavascriptWebApps e Frameworks Javascript
WebApps e Frameworks Javascriptmeet2Brains
 
The world's next top data model
The world's next top data modelThe world's next top data model
The world's next top data modelPatrick McFadin
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePointMarc D Anderson
 
Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Scott Leberknight
 
Render API - Pavel Makhrinsky
Render API - Pavel MakhrinskyRender API - Pavel Makhrinsky
Render API - Pavel MakhrinskyDrupalCampDN
 
Advanced GORM - Performance, Customization and Monitoring
Advanced GORM - Performance, Customization and MonitoringAdvanced GORM - Performance, Customization and Monitoring
Advanced GORM - Performance, Customization and MonitoringBurt Beckwith
 
Viking academy backbone.js
Viking academy  backbone.jsViking academy  backbone.js
Viking academy backbone.jsBert Wijnants
 
Effiziente Datenpersistierung mit JPA 2.1 und Hibernate
Effiziente Datenpersistierung mit JPA 2.1 und HibernateEffiziente Datenpersistierung mit JPA 2.1 und Hibernate
Effiziente Datenpersistierung mit JPA 2.1 und HibernateThorben Janssen
 
Indexing in Cassandra
Indexing in CassandraIndexing in Cassandra
Indexing in CassandraEd Anuff
 

Was ist angesagt? (20)

Modularity and Layered Data Model
Modularity and Layered Data ModelModularity and Layered Data Model
Modularity and Layered Data Model
 
Intro To jQuery In Drupal
Intro To jQuery In DrupalIntro To jQuery In Drupal
Intro To jQuery In Drupal
 
BITS: Introduction to relational databases and MySQL - Schema design
BITS: Introduction to relational databases and MySQL - Schema designBITS: Introduction to relational databases and MySQL - Schema design
BITS: Introduction to relational databases and MySQL - Schema design
 
JavaScript for Flex Devs
JavaScript for Flex DevsJavaScript for Flex Devs
JavaScript for Flex Devs
 
Client-side MVC with Backbone.js
Client-side MVC with Backbone.js Client-side MVC with Backbone.js
Client-side MVC with Backbone.js
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Railswaycon Inside Matz Ruby
Railswaycon Inside Matz RubyRailswaycon Inside Matz Ruby
Railswaycon Inside Matz Ruby
 
MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!
 
Organizing Code with JavascriptMVC
Organizing Code with JavascriptMVCOrganizing Code with JavascriptMVC
Organizing Code with JavascriptMVC
 
Simpler Core Data with RubyMotion
Simpler Core Data with RubyMotionSimpler Core Data with RubyMotion
Simpler Core Data with RubyMotion
 
WebApps e Frameworks Javascript
WebApps e Frameworks JavascriptWebApps e Frameworks Javascript
WebApps e Frameworks Javascript
 
The world's next top data model
The world's next top data modelThe world's next top data model
The world's next top data model
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePoint
 
Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0
 
Render API - Pavel Makhrinsky
Render API - Pavel MakhrinskyRender API - Pavel Makhrinsky
Render API - Pavel Makhrinsky
 
Advanced GORM - Performance, Customization and Monitoring
Advanced GORM - Performance, Customization and MonitoringAdvanced GORM - Performance, Customization and Monitoring
Advanced GORM - Performance, Customization and Monitoring
 
Viking academy backbone.js
Viking academy  backbone.jsViking academy  backbone.js
Viking academy backbone.js
 
Effiziente Datenpersistierung mit JPA 2.1 und Hibernate
Effiziente Datenpersistierung mit JPA 2.1 und HibernateEffiziente Datenpersistierung mit JPA 2.1 und Hibernate
Effiziente Datenpersistierung mit JPA 2.1 und Hibernate
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Indexing in Cassandra
Indexing in CassandraIndexing in Cassandra
Indexing in Cassandra
 

Ähnlich wie In Pursuit of the Grand Unified Template

Service Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIService Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIRoselin Mary S
 
XSLT and XPath - without the pain!
XSLT and XPath - without the pain!XSLT and XPath - without the pain!
XSLT and XPath - without the pain!Bertrand Delacretaz
 
SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Languageelliando dias
 
Service Oriented Architecture- UNIT 2- XSL
Service Oriented Architecture- UNIT 2- XSLService Oriented Architecture- UNIT 2- XSL
Service Oriented Architecture- UNIT 2- XSLRoselin Mary S
 
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power StackRails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power StackDavid Copeland
 
DSpace 4.2 XMLUI Theming
DSpace 4.2 XMLUI ThemingDSpace 4.2 XMLUI Theming
DSpace 4.2 XMLUI ThemingDuraSpace
 
PostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersPostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersAmanda Gilmore
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesDoris Chen
 
Dax Declarative Api For Xml
Dax   Declarative Api For XmlDax   Declarative Api For Xml
Dax Declarative Api For XmlLars Trieloff
 
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsJava Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsIMC Institute
 

Ähnlich wie In Pursuit of the Grand Unified Template (20)

Service Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIService Oriented Architecture - Unit II
Service Oriented Architecture - Unit II
 
XSLT and XPath - without the pain!
XSLT and XPath - without the pain!XSLT and XPath - without the pain!
XSLT and XPath - without the pain!
 
SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Language
 
Service Oriented Architecture- UNIT 2- XSL
Service Oriented Architecture- UNIT 2- XSLService Oriented Architecture- UNIT 2- XSL
Service Oriented Architecture- UNIT 2- XSL
 
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power StackRails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power Stack
 
DSpace 4.2 XMLUI Theming
DSpace 4.2 XMLUI ThemingDSpace 4.2 XMLUI Theming
DSpace 4.2 XMLUI Theming
 
Jstl Guide
Jstl GuideJstl Guide
Jstl Guide
 
DB2 Native XML
DB2 Native XMLDB2 Native XML
DB2 Native XML
 
PostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersPostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL Superpowers
 
XSLT for Web Developers
XSLT for Web DevelopersXSLT for Web Developers
XSLT for Web Developers
 
Scala active record
Scala active recordScala active record
Scala active record
 
Xml 2
Xml  2 Xml  2
Xml 2
 
Sequelize
SequelizeSequelize
Sequelize
 
Performance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best PracticesPerformance Optimization and JavaScript Best Practices
Performance Optimization and JavaScript Best Practices
 
26xslt
26xslt26xslt
26xslt
 
Dax Declarative Api For Xml
Dax   Declarative Api For XmlDax   Declarative Api For Xml
Dax Declarative Api For Xml
 
Xsd tutorial
Xsd tutorialXsd tutorial
Xsd tutorial
 
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsJava Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom Tags
 
Schematron
SchematronSchematron
Schematron
 
Camel as a_glue
Camel as a_glueCamel as a_glue
Camel as a_glue
 

Mehr von hannonhill

Cascade + Bootstrap = Awesome
Cascade + Bootstrap = AwesomeCascade + Bootstrap = Awesome
Cascade + Bootstrap = Awesomehannonhill
 
Web Governance Crash Course: Creating a Sustainable Digital Transformation
Web Governance Crash Course: Creating a Sustainable Digital TransformationWeb Governance Crash Course: Creating a Sustainable Digital Transformation
Web Governance Crash Course: Creating a Sustainable Digital Transformationhannonhill
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Serverhannonhill
 
Using Cascade technology to increase SEO/Landing Page Optimization
Using Cascade technology to increase SEO/Landing Page OptimizationUsing Cascade technology to increase SEO/Landing Page Optimization
Using Cascade technology to increase SEO/Landing Page Optimizationhannonhill
 
Information Architecture and User Experience: The Journey, The Destination, T...
Information Architecture and User Experience: The Journey, The Destination, T...Information Architecture and User Experience: The Journey, The Destination, T...
Information Architecture and User Experience: The Journey, The Destination, T...hannonhill
 
Connecting Ecommerce & Centralized Analytics to Cascade Server
Connecting Ecommerce & Centralized Analytics to Cascade ServerConnecting Ecommerce & Centralized Analytics to Cascade Server
Connecting Ecommerce & Centralized Analytics to Cascade Serverhannonhill
 
Data Modeling with Cascade Server and HighCharts JS
Data Modeling with Cascade Server and HighCharts JSData Modeling with Cascade Server and HighCharts JS
Data Modeling with Cascade Server and HighCharts JShannonhill
 
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...hannonhill
 
Fun with Cascade Server!
Fun with Cascade Server!Fun with Cascade Server!
Fun with Cascade Server!hannonhill
 
Accessibility in Practice: Integrating Web Accessibility into Cascade Training
Accessibility in Practice:  Integrating Web Accessibility into Cascade TrainingAccessibility in Practice:  Integrating Web Accessibility into Cascade Training
Accessibility in Practice: Integrating Web Accessibility into Cascade Traininghannonhill
 
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade ServerCrowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade Serverhannonhill
 
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...hannonhill
 
Climbing Migration Mountain: 200+ Sites from the Ground Up
Climbing Migration Mountain: 200+ Sites from the Ground UpClimbing Migration Mountain: 200+ Sites from the Ground Up
Climbing Migration Mountain: 200+ Sites from the Ground Uphannonhill
 
Cusestarter or How We Built Our Own Crowdfunding Platform
Cusestarter or How We Built Our Own Crowdfunding PlatformCusestarter or How We Built Our Own Crowdfunding Platform
Cusestarter or How We Built Our Own Crowdfunding Platformhannonhill
 
Web Services: Encapsulation, Reusability, and Simplicity
Web Services: Encapsulation, Reusability, and SimplicityWeb Services: Encapsulation, Reusability, and Simplicity
Web Services: Encapsulation, Reusability, and Simplicityhannonhill
 
Cascade Server: Past, Present, and Future!
Cascade Server: Past, Present, and Future!Cascade Server: Past, Present, and Future!
Cascade Server: Past, Present, and Future!hannonhill
 
Web Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web ServicesWeb Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web Serviceshannonhill
 
Outputting Their Full Potential: Using Outputs for Site Redesigns and Develo...
Outputting Their Full Potential: Using Outputs for Site Redesigns andDevelo...Outputting Their Full Potential: Using Outputs for Site Redesigns andDevelo...
Outputting Their Full Potential: Using Outputs for Site Redesigns and Develo...hannonhill
 
Redesign in Cascade Server
Redesign in Cascade ServerRedesign in Cascade Server
Redesign in Cascade Serverhannonhill
 

Mehr von hannonhill (20)

Cascade + Bootstrap = Awesome
Cascade + Bootstrap = AwesomeCascade + Bootstrap = Awesome
Cascade + Bootstrap = Awesome
 
Web Governance Crash Course: Creating a Sustainable Digital Transformation
Web Governance Crash Course: Creating a Sustainable Digital TransformationWeb Governance Crash Course: Creating a Sustainable Digital Transformation
Web Governance Crash Course: Creating a Sustainable Digital Transformation
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Server
 
Using Cascade technology to increase SEO/Landing Page Optimization
Using Cascade technology to increase SEO/Landing Page OptimizationUsing Cascade technology to increase SEO/Landing Page Optimization
Using Cascade technology to increase SEO/Landing Page Optimization
 
Information Architecture and User Experience: The Journey, The Destination, T...
Information Architecture and User Experience: The Journey, The Destination, T...Information Architecture and User Experience: The Journey, The Destination, T...
Information Architecture and User Experience: The Journey, The Destination, T...
 
2 Men 1 Site
2 Men 1 Site2 Men 1 Site
2 Men 1 Site
 
Connecting Ecommerce & Centralized Analytics to Cascade Server
Connecting Ecommerce & Centralized Analytics to Cascade ServerConnecting Ecommerce & Centralized Analytics to Cascade Server
Connecting Ecommerce & Centralized Analytics to Cascade Server
 
Data Modeling with Cascade Server and HighCharts JS
Data Modeling with Cascade Server and HighCharts JSData Modeling with Cascade Server and HighCharts JS
Data Modeling with Cascade Server and HighCharts JS
 
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
 
Fun with Cascade Server!
Fun with Cascade Server!Fun with Cascade Server!
Fun with Cascade Server!
 
Accessibility in Practice: Integrating Web Accessibility into Cascade Training
Accessibility in Practice:  Integrating Web Accessibility into Cascade TrainingAccessibility in Practice:  Integrating Web Accessibility into Cascade Training
Accessibility in Practice: Integrating Web Accessibility into Cascade Training
 
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade ServerCrowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
 
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
 
Climbing Migration Mountain: 200+ Sites from the Ground Up
Climbing Migration Mountain: 200+ Sites from the Ground UpClimbing Migration Mountain: 200+ Sites from the Ground Up
Climbing Migration Mountain: 200+ Sites from the Ground Up
 
Cusestarter or How We Built Our Own Crowdfunding Platform
Cusestarter or How We Built Our Own Crowdfunding PlatformCusestarter or How We Built Our Own Crowdfunding Platform
Cusestarter or How We Built Our Own Crowdfunding Platform
 
Web Services: Encapsulation, Reusability, and Simplicity
Web Services: Encapsulation, Reusability, and SimplicityWeb Services: Encapsulation, Reusability, and Simplicity
Web Services: Encapsulation, Reusability, and Simplicity
 
Cascade Server: Past, Present, and Future!
Cascade Server: Past, Present, and Future!Cascade Server: Past, Present, and Future!
Cascade Server: Past, Present, and Future!
 
Web Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web ServicesWeb Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web Services
 
Outputting Their Full Potential: Using Outputs for Site Redesigns and Develo...
Outputting Their Full Potential: Using Outputs for Site Redesigns andDevelo...Outputting Their Full Potential: Using Outputs for Site Redesigns andDevelo...
Outputting Their Full Potential: Using Outputs for Site Redesigns and Develo...
 
Redesign in Cascade Server
Redesign in Cascade ServerRedesign in Cascade Server
Redesign in Cascade Server
 

Kürzlich hochgeladen

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Kürzlich hochgeladen (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

In Pursuit of the Grand Unified Template

  • 1. In Pursuit of the Grand Unified Template or Page Level Formats Jason Aller UC Davis School of Law #csuc14, @JasonAller
  • 2. Who am I? • Cascade Server Admin and Developer • This is my seventh Users Conference • I make things like: – The Cascade Entity Relationship Diagram – grunt-cascade-deploy on github – soap-cascade on github
  • 3. A thanks to the folks at Tarleton As the manager of www.tarleton.edu, Web Services reserves the right to edit any Tarleton webpage at any time in order to make corrections and improvements to items such as misspellings, poor content structure, accessibility issues, copyright issues, security issues, and outdated information. Web Services may not contact the content owner in advance but will make an effort to communicate the changes and issues soon after they are made.
  • 4. Overview I’m going to be using XSLT for my examples, though I did buy “Velocity: The Basics” by James Johnson • Changing Links • Conditional Restructuring - Bootstrap • Exposing additional data at the page level
  • 5. Conditional Restructuring • Bootstrap – but can be used with many other CSS frameworks • One design with multiple layouts • From a single template • Let the system do all the work automatically • Because automating the CMS is more effective than training content contributors
  • 6. The page as XML source
  • 7. XSLT Default Templates • Traverse Elements <xsl:template match="*|/"> <xsl:apply-templates/> </xsl:template> • Process content and attributes <xsl:template match="text()|@*"> <xsl:value-of select="."/> </xsl:template> • Remove comments and processing instructions <xsl:template match="processing-instruction()| comment()"/>
  • 8. Changing Links • Find with XPath – <a… – <a href="http… – <a href="mailto:… • Process the element (copy, modify, remove) • Unless removing, send that element’s content to be processed – recurse
  • 9. Changing Links • Add Google Tracking to outgoing links • Append a non-breaking space and an icon after the link for links to PDF and PowerPoint files
  • 10. Link code <xsl:template match="node()[name() = 'a']"> <!-- begin copying the source node --> <xsl:copy> <!-- If we might want to track this with Google: --> <xsl:if test="starts-with(@href,'http')"> <xsl:choose> <!-- Check if there is already an onClick event and add ours --> <xsl:when test="@onClick"> <xsl:attribute name="onClick"> <xsl:value-of select="concat(@onClick,' ')"/> <xsl:call-template name="pageTracker"/> </xsl:attribute> </xsl:when> <!-- of if there wasn't an onClick event add one --> <xsl:otherwise> <xsl:attribute name="onClick"> <xsl:call-template name="pageTracker"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:if>
  • 11. Link code cont. <!-- process non-onClick attributes and child nodes --> <xsl:apply-templates select="@*[name() != 'onClick']|node()"/> <!-- figure out if we need to add docIcons --> <xsl:choose> <xsl:when test="child::node()[name() = 'img']"> <!-- Do nothing, because link is wrapped around graphic --> </xsl:when> <xsl:when test="substring(@href,string-length(@href)-3,4) = '.pdf'"> <xsl:text>&#160;</xsl:text> <span class="sprite pdf-n"></span> </xsl:when> <xsl:when test="substring(@href,string-length(@href)-3,4) = '.ppt' or substring(@href,string-length(@href)-4,5) = '.pptx'"> <xsl:text>&#160;</xsl:text> <span class="sprite ppt-n"></span> </xsl:when> <xsl:otherwise/> </xsl:choose> </xsl:copy> </xsl:template>
  • 12. pageTracker <xsl:template name="pageTracker"> <xsl:text>javascript:pageTracker.</xsl:text> <xsl:text>_trackPageview('</xsl:text> <xsl:value-of select="$pagePath"/> <xsl:text>/outgoing/</xsl:text> <xsl:value-of select="translate(., $singleQuote, '')"/> <xsl:text>/</xsl:text> <xsl:value-of select="substring-after (@href,'http://')"/> <xsl:text>');</xsl:text> </xsl:template> /current/portal/outgoing/Intranet/intranet.law.ucdavis.edu/index.aspx
  • 13. Conditional Restructuring • Determine rules – Decide the logic once, then apply it • Output alternative wrapper elements • Process content – recurse • It’s turtles all the way down
  • 14.
  • 15. navmidbar(2) 2 8 2 navmidbar(3) 2 7 3 navmid 2 10 midbar(2) 10 2 midbar(3) 9 3 mid 12 home 4 5 3 Phone
  • 16. home 4 5 3
  • 21. Bootstrap Bootstrap is based on 12 columns and wants <div class="col-sm-3"> or <div class="col-sm-2"> We want to have a single template to maintain that can allow three columns with the following options: • Left – either 2 or 0 • Main – either 7, 8, 9, 10, or 12 – fills space • Right – either 0, 2, or 3
  • 22. One Template <div id="zeroth"> <div class="row"> <div id="first"> <system-region name="SUBNAV"/> <system-region name="QUICKLINKS"/> </div> <div id="second"> <system-region name="CONTENT-TITLE"/> <system-region name="DEFAULT-PRE"/> <system-region name="DEFAULT"/> <system-region name="DEFAULT-POST"/> </div> <div id="third"> <system-region name="SIDEBAR-TOP"/> <system-region name=“SIDEBAR"/> <system-region name="SIDEBAR-BOTTOM"/> </div> </div> </div>
  • 23. Pseudocode Tour • Check for content in each area • Pick a layout based on this • For each area apply the rules of that layout – zeroth – first – second – third
  • 24. Checking for <div> Content <xsl:variable name="con1" select="count( //node() [name()='div'] [@id='first'] /*[not( name() = 'img' and substring(@src,1,10) = '/css/icons')])"/>
  • 25. Layout Assignment Logic <xsl:variable name="layout"> <xsl:choose> <xsl:when test="$pagePath = '/index'"> <xsl:text>home</xsl:text> </xsl:when> <xsl:when test="$con1 = 0 and not($con2 = 0) and $con3 = 0"> <xsl:text>mid</xsl:text> </xsl:when> home 4 5 3 mid 12
  • 26. Layout cont. <xsl:when test="not($con1 = 0) and not($con2 = 0) and $con3 = 0"> <xsl:text>navmid</xsl:text> </xsl:when> <xsl:when test="not($con1 = 0) and not($con2 = 0) and not($con3 = 0)"> <xsl:text>navmidbar</xsl:text> </xsl:when> <xsl:when test="$con1 = 0 and not($con2 = 0) and not($con3 = 0)"> <xsl:text>midbar</xsl:text> </xsl:when> navmid 2 10 navmidbar(2) 2 8 2 midbar(2) 10 2
  • 27. Layout cont. <xsl:otherwise> <xsl:text>default</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable>
  • 28. zeroth <xsl:template match="node()[name()='div'][@id='zeroth']"> <xsl:choose> <xsl:when test="$layout = 'home'"> <div class="container" id="content"> <xsl:apply-templates select="node()"/> </div> </xsl:when> <xsl:otherwise> <div class="container"> <xsl:apply-templates select="node()"/> </div> </xsl:otherwise> </xsl:choose> </xsl:template>
  • 29. first <xsl:template match="node() [name()='div'][@id='first']"> <xsl:choose> <xsl:when test="$layout = 'home'"> <div class="col-md-3 col-md-push-9"> <xsl:apply-templates /> </div> </xsl:when> home 4 5 3
  • 30. first cont. <xsl:when test="$layout = 'navmid' or $layout = 'navmidbar'"> <div class="col-sm-2"> <xsl:if test="./div[@id = 'subNav'] or ./div[@id = 'relatedLinks'] or ./div[@class = 'left-column-full- width']"> <xsl:attribute name="class"> <xsl:text>col-sm-2 left-column</xsl:text> </xsl:attribute> </xsl:if> <xsl:apply-templates /> </div> </xsl:when> navmidbar(2) 2 8 2
  • 31. first cont. <xsl:otherwise/> </xsl:choose> </xsl:template> midbar(2) 10 2 midbar(3) 9 3 mid 12
  • 32. second <xsl:template match="node() [name()='div'][@id='second']"> <xsl:choose> <xsl:when test="$layout = 'home'"> <div class="col-md-4 col-md-pull-3"> <xsl:apply-templates select="node()"/> </div> </xsl:when> <xsl:when test="$layout = 'mid'"> <div class="col-sm-12" id="content"> <xsl:apply-templates select="node()"/> </div> </xsl:when> mid 12 home 4 5 3
  • 33. second cont. <xsl:when test="$layout = 'navmid'"> <div class="col-sm-10" id="content"> <xsl:apply-templates select="node()"/> </div> </xsl:when> <xsl:when test="$layout = 'midbar'"> <div id="content"> <xsl:attribute name="class"> <xsl:choose> <xsl:when test="$sidebar = '3'"> <xsl:text>col-sm-9</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>col-sm-10</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates select="node()"/> </div> </xsl:when> navmid 2 10 midbar(3) 9 3 midbar(2) 10 2
  • 34. second cont. <xsl:otherwise> <div id="content"> <xsl:attribute name="class"> <xsl:choose> <xsl:when test="$sidebar = '3'"> <xsl:text>col-sm-7</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>col-sm-8</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates /> </div> </xsl:otherwise> </xsl:choose> </xsl:template> navmidbar(2) 2 8 2 navmidbar(3) 2 7 3
  • 35. third <xsl:template match="node() [name()='div'][@id='third']"> <xsl:choose> <xsl:when test="$layout = 'home'"> <div class="col-md-5 col-md-pull-3"> <xsl:apply-templates /> </div> </xsl:when> home 4 5 3
  • 36. third cont. <xsl:when test="$layout = 'navmidbar' or $layout = 'midbar'"> <div id="right-column"> <xsl:attribute name="class"> <xsl:choose> <xsl:when test="$sidebar = '3'"> <xsl:text>col-sm-3</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>col-sm-2</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates /> </div> </xsl:when> midbar(3) 9 3 midbar(2) 10 2
  • 37. third cont. <xsl:otherwise/> </xsl:choose> </xsl:template>
  • 38. Exposing metadata at the page level • Expose at template level • Extract values to variables • Add rule to remove – swallow it with the format
  • 39. Insert • <system-region name="CASCADE-METADATA"/> • Index block self-metadata • <xsl:template match="/"> <xsl:copy-of select="/"/> </xsl:template>
  • 40. Extract Pull the page path out: • <xsl:variable name="pagePath" select="//calling-page/system-page/path"/> Pull page metadata: • <xsl:variable name="sidebar" select="//calling-page/system-page/dynamic-metadata[ name = 'sidebar']/value"/> Swallow the data to prevent publishing it: • <xsl:template match="node()[name() = 'system-index- block']"/>
  • 41. Future plans • RFC3966 tel: URI • Not <blockquote> from <p> with “” – I’ll write my own replacement for TinyMCE before I do that! With Cascade 8 I won’t have to! • Use [system-view:internal] and [system-view: external] to highlight violations of the style guide • Take a vacation

Hinweis der Redaktion

  1. Regular links, outgoing links, e-mail links
  2. You’ll note the use of the variable $pagePath here, I’ll cover how we generate that later
  3. Start at the current page and include its folder hierarchy Indexed Asset Content Regular Content System Metadata User Metadata Other Indexed Info Append Calling Page Data