370 likes | 382 Views
Power Hour May 2010 Page Templates. Ben Allums Jesse Wiles. Power Hour – May 2010. Agenda Survey Results Page Templates What are page templates? What can I do with them? How do they work? How can I make them my own? Can we make this easier? Webinars of Interest. Power Hour – May 2010.
E N D
Power HourMay 2010Page Templates Ben Allums Jesse Wiles
Power Hour – May 2010 Agenda • Survey Results • Page Templates • What are page templates? • What can I do with them? • How do they work? • How can I make them my own? • Can we make this easier? • Webinars of Interest
Power Hour – May 2010 Survey Results
Survey Results When to meet:
Survey Results Topics to cover:
Survey Results Topics to cover: • Context-sensitive Help
Power Hour – May 2010 Page Templates
Page Templates • What are page templates? • What can I do with them? • How do they work? • How can I make them my own? • Can we make this easier?
Page Templates • What are page templates? • What can I do with them? • How do they work? • How can I make them my own? • Can we make this easier?
What are page templates? • Page layouts defined with XML • Usable for XML, HTML, and Text page designs • Safe to customize without fear of upgrade hassles • No XSLT or JavaScript coding required
What are page templates? Comprised of three parts: • Replacements • Conditions • Layout Layout Replacement Condition
What are page templates? Replacements Content <h1>Title</h1><div class=“Body”>The beginning… Previous <a href=“previous.html”><imgsrc=“prev.gif” /></a> Next <a href=“next.html”><imgsrc=“next.gif” /></a> Company Name WebWorks Company Logo <imgsrc=“logo.gif” /> Email info@webworks.com
What are page templates? Conditions Header Exists Header, Footer Exist Footer Exists Index Exists TOC Exists Email Exists
What are page templates? Layouts TOC Exists Index Exists Index <a href=“index.html”><imgsrc=“index.gif” /></a> TOC <a href=“toc.html”><imgsrc=“toc.gif” /></a> Content <h1>Title</h1><div class=“Body”>The beginning…
Page Templates • What are page templates? • What can I do with them? • How do they work? • How can I make them my own? • Can we make this easier?
What can I do with them? • Enable designers to build complex layouts • “Pour” your content into page designs • Maintain designs outside of XSL transforms
What can I do with them? Why make replacements and conditions separate? • Allows you to think about each aspect and the effect on layout separately • Allows you to define replacements that are never used • Enables layout to vary based on available conditions
What can I do with them? Vary designs NavigationExists TOC Exists Index Exists TOC Index Content
What can I do with them? Vary designs TOC Index TOC Index Content Content
What can I do with them? Vary designs NavigationExists TOC Exists Index Exists TOC Index Content
What can I do with them? Vary designs Content Content
Page Templates • What are page templates? • What can I do with them? • How do they work? • How can I make them my own? • Can we make this easier?
How do they work? Nuts and bolts • Define conditions and replacements in XSL • Transforms\pages.xsl • Define layout in page template • Pages\Page.asp • Apply conditions and replacements to page template • Transforms\pages.xsl • Shared\common\pages\pagetemplate.xsl • Used in other places too! • Transforms\wrappers.xsl • Transforms\popups.xsl
How do they work? Conditions and Replacements in XSL • Replacements • <wwpage:Replacement name="title“ value="{$ParamSplit/@title}" /> • <wwpage:Replacement name=“content"> <xsl:call-template name="Content-Content"> … </xsl:call-template> …</wwpage:Replacement> • Conditions • <wwpage:Condition name="header-exists" /> • <wwpage:Condition name="keywords-exist" />
How do they work? Layout replacements and conditions in the page template • Page.asp<html …> <head> <meta wwpage:condition="keywords-exist“ name="keywords" content="keywords“wwpage:attribute-content="meta-keywords" /> <title wwpage:content="title">Title</title> </head> <body> <div wwpage:replace=“content”>Content goes here!</div> </body></html>
How do they work? Markup to know: • Replacements wwpage:content • <div wwpage:content=“content”>Put content in here!</div> • <div>Replacement content!</div> wwpage:replace • <div wwpage:replace=“content”>Replace div</div> • Replacement content! wwpage:attribute-{attribute} • <meta name="keywords" content="keywords“wwpage:attribute-content="meta-keywords" /> • <meta name="keywords" content=“Replacement content!“ />
How do they work? Markup to know: • Replacements (special) wwpage:attribute-{attribute}=“copy-relative-to-output” • <script src="scripts/expand.js“wwpage:attribute-src="copy-relative-to-output"></script> • <script src=“../../scripts/expand.js“</script> wwpage:attribute-{attribute}=“relative-to-output” • <script src="wwhdata/common/context.js“wwpage:attribute-src="relative-to-output"></script> • <script src=“../../wwhdata/common/context.js“</script>
How do they work? Markup to know: • Conditions wwpage:condition • <br wwpage:condition="company-info-top" clear="all" /> • <br clear="all" />
Page Templates • What are page templates? • What can I do with them? • How do they work? • How can I make them my own? • Can we make this easier?
How can I make them my own? • Variables • Define variable name in the Style Designer • Embed into page template with “wwvars:{variable name}” • <div wwpage:content=“wwvars:PubDate”>00/00/0000</div> • <div>05/27/2010</div> • Define your own replacements and conditions • Pages • Transforms\pages.xsl • Images (full size from thumbnails) • Transforms\wrappers.xsl • Popups (if supported by the format) • Transforms\popups.xsl
Page Templates • What are page templates? • What can I do with them? • How do they work? • How can I make them my own? • Can we make this easier?
Can we make this easier? • Multiple page templates • Page.asp for pages • Image.asp for image wrappers • Popup.asp for popups • Select page template in Style Designer • May need to leverage per target settings • Fallback to Page.asp if requested template missing • Other ideas?
Power Hour – May 2010 Webinars of Interest
Webinars of Interest Show Me: • Learn what the ePublisher platform can do for you right out of the box. • Hosted by members of the WebWorks staff • Repeats on the third Thursday of every month Sign-up at http://www.webworks.com/Resources/Events/Show_Me/Archive/
Webinars of Interest Study Hall: • Open forum for ePublisher users to ask questions and request help on custom projects • Hosted by members of the WebWorks development staff • Repeats on the 2nd and last Wednesdays of every month Join at http://www.webworks.com/Resources/Events/Study_Hall/
Webinars of Interest Archives: • Power Hourhttp://www.webworks.com/Resources/Events/Power_Hour/Archive/ • Show Me!http://www.webworks.com/Resources/Events/Show_Me/Archive/
Power HourMay 2010Page Templates Ben Allums Jesse Wiles