creating new page and section templates robert kiffe senior web developer, omniupdate, inc

40
Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc.

Upload: vivian-mckinney

Post on 22-Dec-2015

226 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Creating New Page and Section Templates

Robert KiffeSenior Web Developer,

OmniUpdate, Inc.

Page 2: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Agenda

Part 1•Background: •OU Campus as a System•Too Many Templates!

•Page ‘Tagging’ for Editable Regions•Hands-On: ‘Tagging’ an HTML Page

•New Page Forms•Hands-On: Creating New HTML Pages

Page 3: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Agenda

Part 2•Background: The Move to XML/XSL•What is a Publish Control File?•Hands-On: Building a PCF

•Advanced New Page/Section Forms•Hands-On: Creating New PCF Pages•Hands-On: Creating New Sections

•Best Practices

Page 4: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

BACKGROUNDOU Campus as a System + Too Many Templates!

Page 5: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

OU Campus as a System• Basic Setup: two separate servers

(Decoupled)• Staging (OU Campus)• Production (Web Server)

• OU Campus “Publishes” files to the web server using an (S)FTP connection.

• Published files are ‘stand-alone’ and do not require OU Campus to render.

Page 6: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Too Many Templates!XSL Templates New Page

TemplatesForm Components: Image (GIF/PNG) TCF – Form for

creating a new page/section

TMPL – File template used for page creation

PCF + XSL• Interior Page

• One Column• Two Column

• Etc…

Design TemplatesHTML Layouts• One Column• Two Column• Landing• Homepage• Etc…

Page 7: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

PAGE TAGGINGEditable Regions in OU Campus

Page 8: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Page Tagging: Overview

• Defines editable elements on a page• Specialized Comment Tags or XML Nodes

• Original ‘comment’ format: <!-- com.omniupdate.div -->• New ‘comment’ format: <!-- ouc:div -->• New ‘node’ format: <ouc:div>

• Unique to OU Campus• Tags are utilized in “Preview” and especially “Edit”

page states

Page 9: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Properties (now Parameters)

• Ex. <ouc:properties>…</ouc:properties>• Defines editable elements outside traditional content areas

• Examples:• Title (<title>Page Title</title>)• Metadata• Page Layout Options (PCF only)• Form-like Data Entry (PCF only)

• Availability of properties can be restricted by group• Extends the same page to be used for different uses

Page 10: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Region Dividers

• Ex. <ouc:div label="content" group="Admins" button="007">…</ouc:div>

• Must close at the end of the region• Multiple editable regions can be associated with a page, but

“label” attribute must be unique• Must include the following attributes:

• Label• Group• ‘Button’ identifier or ‘Path’ for include files

• Use “Path” attribute to define the path to a local file in ‘staging’, to simulate a server-side include

Page 11: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Editors• Source Code Editor Example:

<ouc:div …><ouc:editor wysiwyg="no" /> Code … </ouc:div>• Must self-close (if node)• Must be placed at the start of an editable region• Two Types of WYSIWYG Editors (choice is set by administrators):

• Classic• JustEdit (Just Released!)

• Important Attributes:• wysiwyg = yes (default) | no (Source Editor) | asset (Asset Chooser)• css-path = link to local CSS file to style editor contents• css-menu = link to local text file to populate ‘styles dropdown’• wysiwyg-class = adds a CSS class inside ‘classic’ editor for styling purposes

• Additional attributes used depending on editor type

Page 12: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Side Topic: ‘Styles Dropdown’

• Text file that is used for adding ‘classes’ to HTML objects in the WYSIWYG• “block” setting will apply the class to the parent ‘block-level’ tag (ex.

Paragraph, Divider (div), Image, etc.)• Non-”block” (leaving blank) will default the class to being “in-line”, which

means the WYSIWYG will wrap highlighted content in a SPAN with selected class

• Format: .class[TAB]Friendly Name[TAB]block(optional)

• Examples: .blue Blue Title block .highlight Text Highlight

• Example Output (‘Highlighted’ was selected):<h1 class="blue">Blue Title, <span class="highlight">Highlighted</span></h1>

Page 13: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

MultiEdit Regions

• Text Field Example:<ouc:div label="department" group="Everyone" button="hide"><ouc:multiedit type="text" prompt="Department" alt="Type in the department name." />Mathematics</ouc:div>

• Allows for form-like content entry• For more information, see:

Building Faculty Directories, Profiles, and More with MultiEdit• by Robert Kiffe & Bradley Prasuhn• Thursday, 8-10 AM (Pacific Room)

Page 14: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Additional Tags

• Direct Edit Button:<!-- ouc:ob --><-- /ouc:ob -->

• Full-page Source Editor Button: <!-- ouc:efp --><-- /ouc:efp -->

• DateTime Stamp: <!-- ouc:date --><-- /ouc:date -->

Page 15: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Hands-On:

Tagging an HTML Page

Page 16: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

NEW PAGE FORMSCreating New Pages in OU Campus

Page 17: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Template Structure

STAGING

Page 18: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Template Control File (TCF)

Page 19: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Terminology

TCF = Template Control File• Can contain 4 lists:

• Variable List – Data Entry• Directory List – Folder Creation• Template List – File Creation• Navigation List – Navigation Updates

• May use multiple TMPLs to create multiple files• Multiple TCFs can reference a single TMPL• May be used to pass Access Settings• Can create RSS items• Can only be edited in “Source Editor”

Page 20: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Terminology

TMPL = Template• Used to create *any* file type• Can use ‘echo’ variable statements to collect data

entered in TCF• Ex. <!--%echo var="title" -->

• Fill out with as much or little starting data (or content) as desired.

• Can only be edited in “Source Editor”

Page 21: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Hands-On:

Creating New HTML Pages

Page 22: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

BACKGROUNDThe Move to XML / XSL

Page 23: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Advantages of XML / XSL•Separates ‘Content’ from ‘Design’•XSL logic (scripting) can replace most Server Side coding•Allows for adjustable layouts and optional features•Required for LDP Galleries, LDP Forms, and PDF output•Can be used to create multiple output ‘products’ for each page

Page 24: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

XMLeXtensible Markup Language• In OU Campus PCF and XSL = XML Syntax• Adheres to strict structure • Contains custom element

Main requirements• Entities and markup are to be defined properly• Requires a root element• All tags must properly close• Tags and attributes are case sensitive and must be properly

quoted• Elements must be properly nested

Page 25: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

XSL

eXtensible Stylesheet Language• Transforms data into styled page• Must be formatted in XML structure• Will contain HTML structure, links to CSS, and client-side

or server-side code• Utilizes XPath syntax; ‘directions’ to content in PCF, and

utility functions (like ‘string-length’)• Are not published – changes are immediately available

on staging• Back up files before editing!

Page 26: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

WHAT IS A PUBLISH CONTROL FILE?

Converting to XML/XSL

Page 27: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

PCF

Page 28: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Terminology

PCF = Publish Control File• An XML file, specialized for OU Campus• Arbitrary extension name for pages in Staging Server• Contains PCF stylesheet declaration(s) (XSL declaration)• Contains parameters for Page Properties and metadata• Contains tagging for:

• Editable regions• Custom CSS/instructions for WYSIWYG Editor• MultiEdit tagging

Page 29: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

PCF Transformation ProcessPRODUCTION

STAGING (OU Campus)

WEB PAGE

(HTML, PHP, ASP...)CONTENT STRUCTURE

Page 30: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

PrologueXML declaration

• What version• Encoding

PCF-stylesheet declaration• What XSL is transforming data• What extension should be appended

<?xml version="1.0" encoding="UTF-8"?>

<?pcf-stylesheet path="/_resources/xsl/default.xsl" extension="html" title="Web" ?>

Page 31: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Doctype Definition

•Called DTD•Defines the root element•Provides the entities and markup

<!DOCTYPE document SYSTEM "http://commons.omniupdate.com/dtd/standard.dtd">

Page 32: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Additional Parameters (Properties)

• Example:<parameter name="heading" type="text" prompt="Page Heading">Admissions</parameter>

• Must be placed inside “ouc:properties” tags• Form-based data entry, typically used for layout settings

• Types: Text, Filechooser, Select, Radio, Checkboxes, DateTime Picker• Availability of properties can be restricted by group• Important Attributes:

• “name” - must be unique• “prompt” - is the ‘label’• “alt” - is the help-text description• “type” - (self-explanatory) defaults to ‘text’• “group” - defines group access to see field in ‘properties’ (defaults to ‘None’)

Page 33: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Hands-On:

Building a PCF Page

Page 34: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

NEW PAGE & SECTION FORMS

Advanced

Page 35: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

New PageComponents

Template StructurePRODUCTION

STAGING

Page 36: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Template InheritanceSkin: In OMNI-INFShared across all accounts and sites

Site: In OMNI-INF or Directory in Pages view

Page 37: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Hands-On:

Creating New PCF Pages,Creating New Sections

Page 38: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Best Practices and Reminders

•Repurpose content when possible•Share templates across sites when possible•Use Template Groups to limit where certain files can be created, and to help reduce template ‘clutter’•Follow clear naming conventions and use hyphens•Create contextual TCF image icons•Utilize the Styles drop-down•Plan out access settings and binary management•Encourage and use the WYSIWYG Editor – It “repairs” HTML errors•Always close tags/nodes•For more in-depth information: http://support.omniupdate.com/oucampus10/site-development/templating-framework/index.html

Page 39: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Q&A

Page 40: Creating New Page and Section Templates Robert Kiffe Senior Web Developer, OmniUpdate, Inc

Thank You!

Don’t forget to take our survey

outc15.com/surveys