SlideShare ist ein Scribd-Unternehmen logo
1 von 144
Downloaden Sie, um offline zu lesen
Getting to Know Perch
(and Perch Runway!)
Abby Larsen
PDX CMS, June 2015
Abby Larsen
@abberdab, @happyfanfare

http://www.abbylarsen.com
CMS Content Pain Points
FOR ME, WEB DESIGNER / FRONT-END DEVELOPER
• Opinionated content structure
• Programmatically inserted markup
• WYSIWYG tag soup!
• Programming required for custom content, customized admin
• Unnecessary overhead and complexity for simple content
CMS Content Pain Points
FOR MY CLIENTS, SITE OWNERS AND CONTENT EDITORS
• Scattered admin interfaces
• Superfluous, confusing admin options
• Expensive development time for anything custom
• Lengthy documentation
• Slow load times
Perch
http://www.grabaperch.com
• All content is custom — markup and content structure agnostic
• Use it a little or a lot, can exist alongside other frameworks
• Alternatives to WYSIWYG for rich text
• Tag-based template language, no programming required
• Admin interface mirrors content structure
• Reduced training/documentation time
Technical Requirements
• PHP 5.3 or newer with:
- PDO or mysqli, JSON libraries, GD or ImageMagick
• MySQL 5.0 or newer
• Linux recommended, but other platforms supported
Installation
1. Download Perch
2. Have database information in hand
3. Place the perch directory into the root of your web directory
4. Visit http://www.yourdomain.com/perch/setup in a web browser
5. Submit your license, personal, and database information
6. Log into your new Perch Dashboard!
Getting Started
Our dashboard is empty because Perch isn’t managing any pages, yet. 

To manage a page’s content, we need to:
• Add the Perch runtime statement
• Add a Perch editable region
Perch Runtime Statement
Add the perch runtime statement to the top of your page markup, above the 

<!doctype>. If your page exists in a subdirectory, change the path accordingly.
<?php include('perch/runtime.php');?>
<!doctype>
<html lang="en">
<head>
<title>Our Cats</title>
</head>
Perch Editable Regions
To start managing content on a page, add a Perch page function to that page.
This page function is a Perch editable region. It looks like this:
<section class="slide reverse">
<div class="hero">
<h1>Our Cats</h1>
<h2>by Harrison Weir</h2>
</div>
</section>
Perch Editable Regions
To start managing content on a page, add a Perch page function to that page.
This page function is a Perch editable region. It looks like this:
<section class="slide reverse">
<div class="hero">
<h1><?php perch_content('Heading'); ?></h1>
<h2>by Harrison Weir</h2>
</div>
</section>
Perch Templates
Perch templates contain a mix of markup and Perch template tags. Perch
templates define and format editable region content:
• Admin interface
• Data schema
• Markup
Default Templates
By default, Perch comes with the following content templates. These are just the
starting point!
• Text
• File
• Image
• Code Block
• Text Block
• Google Analytics
• Map
• Article
A Simple Perch Template
The default Text template contains a single Perch template tag of type="text",
and no markup. A Text template controls the “Our Cats” Heading region.
<perch:content id="text" label="Text" type="text"
required="true" title="true" />
Anatomy of a Perch Template Tag
A Perch template tag opens with perch:content and requires id, label, and
type attributes.
<perch:content id="text" label="Text" type="text"
required="true" title="true" />
A more complex, but
typical, Template
This is a portion of the
default Article template.
It contains a mix of
Perch template tags and
markup.
<h2><perch:content id="heading" type="text"
label="Heading" required="true" title="true" /></h2>
<p class="date"><perch:content id="date" type="date"
label="Date" format="%d %B %Y" required="true" /></
p>
<perch:content id="body" type="textarea"
label="Body" markdown="true" editor="markitup"
required="true" />
<p class="vcard">
&copy; <perch:content id="date" type="date"
label="Date" format="Y" />
<span class="fn n">
<perch:content id="author_given_name"
type="text" label="Author given name" />
<perch:content id="author_family_name"
type="text" label="Author family name" />
</span>
</p>
A more complex, but
typical, Template
This is a portion of the
default Article template.
It contains a mix of
Perch template tags and
markup.
<h2><perch:content id="heading" type="text"
label="Heading" required="true" title="true" /></h2>
<p class="date"><perch:content id="date" type="date"
label="Date" format="%d %B %Y" required="true" /></
p>
<perch:content id="body" type="textarea"
label="Body" markdown="true" editor="markitup"
required="true" />
<p class="vcard">
&copy; <perch:content id="date" type="date"
label="Date" format="Y" />
<span class="fn n">
<perch:content id="author_given_name"
type="text" label="Author given name" />
<perch:content id="author_family_name"
type="text" label="Author family name" />
</span>
</p>
An “Opinion” Region
Our “Opinion” region
will contain a mix of
content and markup,
courtesy of the Article
template.
<?php include('perch/runtime.php');?>
<!doctype html>
<html lang="en">
<head>
<title>Our Cats</title>
</head>
<body>
…
<section class="opinion">
<h1>Opinion</h1>
<h2>Regarding the National Cat Club</h2>
<p class="date">15 June 2015</p>
<p>In my former edition of “Our Cats,” I wrote
hopefully and expectantly of much good to be derived
from the institution of the so-called National Cat
Club…</p>
<p class="vcard">&copy; 2015 <span class="fn
n">Harrison Weir, F.H.S.</span></p>
</section>
An “Opinion” Region
Our “Opinion” region
will contain a mix of
content and markup,
courtesy of the Article
template.
<?php include('perch/runtime.php');?>
<!doctype html>
<html lang="en">
<head>
<title>Our Cats</title>
</head>
<body>
…
<section class="opinion">
<h1>Opinion</h1>
<?php perch_region('Opinion'); ?>
</section>
<?php include('perch/runtime.php');?>
<!doctype>
<html lang="en">
<head>
<title>Our Cats</title>
</head>
<h2><perch:content id="heading" type="text"
label="Heading" required="true" title="true" /></h2>
<p class="date"><perch:content id="date" type="date"
label="Date" format="%d %B %Y" required="true" /></
p>
<perch:content id="body" type="textarea"
label="Body" markdown="true" editor="markitup"
required="true" />
<p class="vcard">
&copy; <perch:content id="date" type="date"
label="Date" format="Y" />
<span class="fn n">
<perch:content id="author_given_name"
type="text" label="Author given name" />
<perch:content id="author_family_name"
type="text" label="Author family name" />
</span>
</p>
Perch Tag Types
By default, Perch comes with the following tag types.
• text
• smarttext
• textarea
• date
• select
• radio
• checkbox
• image
• file
• slug
• hidden
• map
• composite
• dataselect
Perch Region Options
Region options are controlled through the Perch Dashboard.
• Multiple Item Regions
• Shared Regions
Multiple Item Regions
Allows your editors to add multiple items, simple or complex, to a region.
EDITING OPTIONS
• All on one page (best for simple items)
• List /detail mode (best for complex items)
DISPLAY OPTIONS
• Customize sort order
• Control number of items displayed
Title Text
Allow multiple items in a region.
Title Text
Shared Regions
Shared regions allow you to edit content for multiple pages in a single place.
Shared Regions
Shared regions are useful for footer text, contact information, or other global
content.
<footer>
<p>
Read the complete <em>Our Cats and All About Them</em>
at <a href="http://www.gutenberg.org/">Project Gutenberg</a>.
</p>
</footer>
Shared Regions
Shared regions are useful for footer text, contact information, or other global
content.
<footer>
<?php perch_region('Footer');>
</footer>
Share across all pages
.
Template Options
Useful options for your template code.
• Repeaters
• Blocks
Repeaters
When you don’t know how many of something you need to manage in a content
item, when editors need the option to add lots or none at all, use a repeater!
• Images
• Documents
• Related links
• Versions of a downloadable thing
• ?
Anatomy of a Repeater
A Perch repeater tag opens with perch:repeater. It requires an id and a label
attribute. An optional max attribute puts a cap on the number of somethings.
<ul>
<perch:repeater id="links" label="Related Links" max="10">
<li><a href="<perch:content id="url" type="text"
label="URL" />"><perch:content type="text" id="desc" label="Link
Text" /></a></li>
</perch:repeater>
</ul>
A job for Perch conditional tags!
Perch Conditional
Tags, in Brief
<perch:before> and
<perch:after> contain
the parts of our
template that should
only display if items
have been added to the
repeater.
<perch:repeater id="links" label="Related Links"
max="10">
<perch:before>
<div class="related-links">
<h3>Related Links</h3>
<ul>
</perch:before>
<li><a href="<perch:content id="url"
type="text" label="URL" />"><perch:content
type="text" id="desc" label="Link Text" /></a></li>
<perch:after>
</ul>
</div>
</perch:after>
</perch:repeater>
Blocks
Perch Blocks in your content template code give content editors a choice of
multiple content formatting options. Each Block is like a micro-template inside
of your content template.
• Can feature custom markup for different content or layout scenarios
• Can contain repeaters and conditionals
Blocks
Blocks exist within a
<perch:blocks> tag
pair. Template tags and
markup for each block
exist within a
<perch:block> tag pair.
<perch:block> tags
require type and label
attributes.
<perch:blocks>
<perch:block type="text" label="Text">
…
</perch:block>
<perch:block type="quote" label="Quote">
…
</perch:block>
<perch:block type="image" label=“Big image">
…
</perch:block>
<perch:block type="image" label=“Inline
image">
…
</perch:block>
</perch:blocks>
Blocks <perch:blocks>
<perch:block type="text" label="Text">
…
</perch:block>
<perch:block type="quote" label="Quote">
…
</perch:block>
<perch:block type="image" label=“Big image">
…
</perch:block>
<perch:block type="image" label=“Inline
image">
…
</perch:block>
</perch:blocks>
Blocks exist within a
<perch:blocks> tag
pair. Template tags and
markup for each block
exist within a
<perch:block> tag pair.
<perch:block> tags
require type and label
attributes.
Example: 

Photo Essay
Template with Blocks
<div class="photo-essay">
<header
style="background:url('<perch:content
id="heading_image" type="image" width="1600"
label="Heading Image" />') center center no-
repeat; background-size:cover;">
<h1><perch:content id="heading" type="text"
label="Heading" required="true" title="true" /
></h1>
</header>
<perch:blocks>
…
</perch:blocks>
</div>
A custom template with
blocks for text, pull
quotes, big images, and
inline images.
Example: 

Photo Essay
Template with Blocks
<perch:block type="text" label="Text">
<perch:content id="text" type="textarea" markdown="true"
editor="markitup" size="s" label="Text" />
</perch:block>
<perch:block type="pullquote" label="Pull quote">
<blockquote>
<perch:content id="quote" type="textarea" markdown="true"
size="xs" label="Quote" />
<cite>&mdash; <perch:content id="cite" type="smarttext"
label="By" /></cite>
</blockquote>
</perch:block>
<perch:block type="image" label="Big image">
<figure class="hero">
<img src="<perch:content id="image" type="image" width="1600"
label="Image" />" class="img-responsive" />
<figcaption><perch:content id="caption" type="smarttext"
label="Caption" /></figcaption>
</figure>
</perch:block>
<perch:block type="inlineimage" label="Inline image">
<figure class="inline <perch:content id="class" type="select"
options="Pull left|pull-left,Pull right|pull-right" label="Alignment"
order="2" />">
<img src="<perch:content id="image" type="image" width="360"
density="2" label="Image" order="1" />" class="img-responsive" />
</figure>
</perch:block>
A custom template with
blocks for text, pull
quotes, big images, and
inline images.
Perch Demo
Photo Essay with Blocks
ADMIN · DISPLAY
List / Detail Pages
Creating this common website pattern in Perch requires the following:
• A detail view content template that includes a slug field
• A list view content template
• A multiple item content region
• The <?php perch_content_custom(); ?> function in your page
Detail template
This is the master
template. It controls the
admin and the individual
news item view.
The existing article
template is included
with <perch:template>.
<perch:template path="content/article.html" />
<perch:content id="slug" for="heading"
type="slug" suppress="true" />
Detail template
The slug field type
makes a URL-friendly
version of our news title
for linking.
The suppress="true"
attribute hides this field
from the admin.
<perch:template path="content/article.html" />
<perch:content id="slug" for="heading"
type="slug" suppress="true" />
List template
The list template
references content ids
defined in the detail
template and contains
the markup for our list
view.
<h2>
<a href="?s=<perch:content id="slug"
type="slug" />">
<perch:content id="heading"
type="text" />
</a>
</h2>
<perch:content id="body" type="textarea"
words="20" append="..." />
<p>
<a href="?s=<perch:content id="slug"
type="slug" />">
Read More &raquo;
</a>
</p>
Initialize a 

multi-item region
Back in our page, we’ll
create our region
programmatically, using
perch_content_create.
This takes care of our
region initialization and
settings in one go.
<?php
perch_content_create('News', array(
'template' => 'custom/detail.html',
'multiple' => true,
'edit-mode' => 'listdetail',
));
?>
List/detail code
Also in our page, we use
the Perch helper
function perch_get()
to check for and get the
slug from the URL.
<?php
if (perch_get('s')) {
perch_content_custom('News', array(
'template' => 'custom/detail.html',
'filter' => 'slug',
'match' => 'eq',
'value' => perch_get('s'),
'count' => 1,
'paginate'=>true
));
} else {
perch_content_custom('News', array(
'template' => 'custom/list.html'
));
}
?>
List/detail code
If a slug exists,
perch_content_custom
displays a slug match
with our detail template.
Otherwise, it displays all
items with the list
template.
<?php
if (perch_get('s')) {
perch_content_custom('News', array(
'template' => 'custom/detail.html',
'filter' => 'slug',
'match' => 'eq',
'value' => perch_get('s'),
'count' => 1,
'paginate'=>true
));
} else {
perch_content_custom('News', array(
'template' => 'custom/list.html'
));
}
?>
Limitations of Perch
If your site is very content-heavy, you might find Perch an awkward fit for the
following reasons:
• Every page requires a corresponding file on the server
• Multi-item regions are versioned at the region level
• All content must be associated with a specific page
Perch Runway
Perch Runway
• Pages no longer need to be a file on the server
• Collections
- Content is no longer tied to a page
- Content can be edited anywhere that makes sense
- Items are individually versioned
- Collections can have relationships to other Collections
Perch Runway
Runway features enterprise-y stuff that might be overkill for smaller sites.
• Multiple page routes
• Task scheduling
• CDN delivery
• Cloud Storage
• Backup to the Cloud or Dropbox
• Varnish support
Collections
Collections are not tied to any page, instead they are managed via the
Collections menu.
Collections
While not tied to a page, Collections can be associated with any (or all!) pages
that would make sense to your content editors.
Relationships
Collections can have relationships to other Collections.
Related Collection content can then be displayed alongside the content for a
different Collection.
Relationships
The <perch:related>
tag in your content
template enables you to
create relationships
between Collections,
then display that related
content.
<perch:related id="author" collection="Authors"
label="Author">
<perch:before>
<h3>Authored by</h3>
<ul>
</perch:before>
<li><a href="/authors/<perch:content
id="slug" type="slug" />"><perch:content
id="author_first_name" type="text" />
<perch:content id="author_last_name" type="text"
/></a></li>
<perch:after>
</ul>
</perch:after>
</perch:related>
End.
Getting to know perch — and perch runway!

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
Terry Ryan
 
HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - Altran
Robert Nyman
 
How does get template part works in twenty ten theme
How does get template part works in twenty ten themeHow does get template part works in twenty ten theme
How does get template part works in twenty ten theme
mohd rozani abd ghani
 
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
Clément Wehrung
 

Was ist angesagt? (20)

Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
AEM - Client Libraries
AEM - Client LibrariesAEM - Client Libraries
AEM - Client Libraries
 
HTML5 - Introduction
HTML5 - IntroductionHTML5 - Introduction
HTML5 - Introduction
 
Wordpress(css,php,js,ajax)
Wordpress(css,php,js,ajax)Wordpress(css,php,js,ajax)
Wordpress(css,php,js,ajax)
 
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component DevelopmentEVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - Ebook
 
Day of code
Day of codeDay of code
Day of code
 
HTML
HTMLHTML
HTML
 
HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - Altran
 
How does get template part works in twenty ten theme
How does get template part works in twenty ten themeHow does get template part works in twenty ten theme
How does get template part works in twenty ten theme
 
html
htmlhtml
html
 
Html5
Html5Html5
Html5
 
Session no 4
Session no 4Session no 4
Session no 4
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
ePub 3, HTML 5 & CSS 3 (+ Fixed-Layout)
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
php 1
php 1php 1
php 1
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVA
 

Andere mochten auch

A Trip To Fiji Islans
A Trip To Fiji IslansA Trip To Fiji Islans
A Trip To Fiji Islans
123saini
 
Scaffold 0c8be2a1 9996-490a-99c0-6ef40baed98a
Scaffold 0c8be2a1 9996-490a-99c0-6ef40baed98aScaffold 0c8be2a1 9996-490a-99c0-6ef40baed98a
Scaffold 0c8be2a1 9996-490a-99c0-6ef40baed98a
uniqcogroup
 
Vasudhaiva kutumbakam
Vasudhaiva kutumbakamVasudhaiva kutumbakam
Vasudhaiva kutumbakam
Deepak Nair
 
grad diploma in accounting
grad diploma in accounting grad diploma in accounting
grad diploma in accounting
Huang Pian
 
My favorite sport is soccer
My favorite sport is soccerMy favorite sport is soccer
My favorite sport is soccer
soniclife
 
Why do we need to manage the resources
Why do we need to manage the resourcesWhy do we need to manage the resources
Why do we need to manage the resources
Shephali Bose
 

Andere mochten auch (20)

A Trip To Fiji Islans
A Trip To Fiji IslansA Trip To Fiji Islans
A Trip To Fiji Islans
 
Plano de negócios Spoiler
Plano de negócios SpoilerPlano de negócios Spoiler
Plano de negócios Spoiler
 
TP LINK TDW 8950ND
TP LINK TDW 8950NDTP LINK TDW 8950ND
TP LINK TDW 8950ND
 
Rainbow BRT - Building upon Pune's Pilot BRT project
Rainbow BRT - Building upon Pune's Pilot BRT projectRainbow BRT - Building upon Pune's Pilot BRT project
Rainbow BRT - Building upon Pune's Pilot BRT project
 
Cd ppt for tpo v1 (1)
Cd   ppt for tpo v1 (1)Cd   ppt for tpo v1 (1)
Cd ppt for tpo v1 (1)
 
MūV Energy Drink (Regular)
MūV Energy Drink (Regular)MūV Energy Drink (Regular)
MūV Energy Drink (Regular)
 
Proxicast PocketPORT 2 User Guide
Proxicast PocketPORT 2 User GuideProxicast PocketPORT 2 User Guide
Proxicast PocketPORT 2 User Guide
 
Quiz mcqs of KBC
Quiz mcqs of KBCQuiz mcqs of KBC
Quiz mcqs of KBC
 
Mythology2
Mythology2Mythology2
Mythology2
 
Scaffold 0c8be2a1 9996-490a-99c0-6ef40baed98a
Scaffold 0c8be2a1 9996-490a-99c0-6ef40baed98aScaffold 0c8be2a1 9996-490a-99c0-6ef40baed98a
Scaffold 0c8be2a1 9996-490a-99c0-6ef40baed98a
 
Build 2016 - P491 - Windows Unlock with IoT Devices
Build 2016 - P491 - Windows Unlock with IoT DevicesBuild 2016 - P491 - Windows Unlock with IoT Devices
Build 2016 - P491 - Windows Unlock with IoT Devices
 
Vasudhaiva kutumbakam
Vasudhaiva kutumbakamVasudhaiva kutumbakam
Vasudhaiva kutumbakam
 
Women Secret Recipe
Women Secret RecipeWomen Secret Recipe
Women Secret Recipe
 
Black Heritage Bible Lesson 8 -Simon of Cyrene
Black Heritage Bible Lesson 8 -Simon of CyreneBlack Heritage Bible Lesson 8 -Simon of Cyrene
Black Heritage Bible Lesson 8 -Simon of Cyrene
 
grad diploma in accounting
grad diploma in accounting grad diploma in accounting
grad diploma in accounting
 
Pak face
Pak facePak face
Pak face
 
My favorite sport is soccer
My favorite sport is soccerMy favorite sport is soccer
My favorite sport is soccer
 
SQL Tuning and VST
SQL Tuning and VST SQL Tuning and VST
SQL Tuning and VST
 
Why do we need to manage the resources
Why do we need to manage the resourcesWhy do we need to manage the resources
Why do we need to manage the resources
 
Html1
Html1Html1
Html1
 

Ähnlich wie Getting to know perch — and perch runway!

Word press templates
Word press templatesWord press templates
Word press templates
Dan Phiffer
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
Heather Rock
 

Ähnlich wie Getting to know perch — and perch runway! (20)

What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)
 
Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)
 
Club website demo
Club website demoClub website demo
Club website demo
 
The web context
The web contextThe web context
The web context
 
Deliverance talk at plone meetup
Deliverance talk at plone meetupDeliverance talk at plone meetup
Deliverance talk at plone meetup
 
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
HTML5 tags.ppt
HTML5 tags.pptHTML5 tags.ppt
HTML5 tags.ppt
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
HTML5 - An introduction
HTML5 - An introductionHTML5 - An introduction
HTML5 - An introduction
 
Guía SEO 2020: Trucos y recomendaciones para desarrolladores y webmasters
Guía SEO 2020: Trucos y recomendaciones para desarrolladores y webmastersGuía SEO 2020: Trucos y recomendaciones para desarrolladores y webmasters
Guía SEO 2020: Trucos y recomendaciones para desarrolladores y webmasters
 
Fundamentals of web_design_v2
Fundamentals of web_design_v2Fundamentals of web_design_v2
Fundamentals of web_design_v2
 
Word press templates
Word press templatesWord press templates
Word press templates
 
GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1GDI Seattle Intermediate HTML and CSS Class 1
GDI Seattle Intermediate HTML and CSS Class 1
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
Club website demo
Club website demoClub website demo
Club website demo
 
Basics of html for web development by software outsourcing company india
Basics of html for web development   by software outsourcing company indiaBasics of html for web development   by software outsourcing company india
Basics of html for web development by software outsourcing company india
 
HTML CSS and Web Development
HTML CSS and Web DevelopmentHTML CSS and Web Development
HTML CSS and Web Development
 

Kürzlich hochgeladen

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Kürzlich hochgeladen (20)

WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 

Getting to know perch — and perch runway!

  • 1. Getting to Know Perch (and Perch Runway!) Abby Larsen PDX CMS, June 2015
  • 3. CMS Content Pain Points FOR ME, WEB DESIGNER / FRONT-END DEVELOPER • Opinionated content structure • Programmatically inserted markup • WYSIWYG tag soup! • Programming required for custom content, customized admin • Unnecessary overhead and complexity for simple content
  • 4. CMS Content Pain Points FOR MY CLIENTS, SITE OWNERS AND CONTENT EDITORS • Scattered admin interfaces • Superfluous, confusing admin options • Expensive development time for anything custom • Lengthy documentation • Slow load times
  • 5. Perch http://www.grabaperch.com • All content is custom — markup and content structure agnostic • Use it a little or a lot, can exist alongside other frameworks • Alternatives to WYSIWYG for rich text • Tag-based template language, no programming required • Admin interface mirrors content structure • Reduced training/documentation time
  • 6. Technical Requirements • PHP 5.3 or newer with: - PDO or mysqli, JSON libraries, GD or ImageMagick • MySQL 5.0 or newer • Linux recommended, but other platforms supported
  • 7. Installation 1. Download Perch 2. Have database information in hand 3. Place the perch directory into the root of your web directory 4. Visit http://www.yourdomain.com/perch/setup in a web browser 5. Submit your license, personal, and database information 6. Log into your new Perch Dashboard!
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. Getting Started Our dashboard is empty because Perch isn’t managing any pages, yet. 
 To manage a page’s content, we need to: • Add the Perch runtime statement • Add a Perch editable region
  • 13.
  • 14. Perch Runtime Statement Add the perch runtime statement to the top of your page markup, above the 
 <!doctype>. If your page exists in a subdirectory, change the path accordingly. <?php include('perch/runtime.php');?> <!doctype> <html lang="en"> <head> <title>Our Cats</title> </head>
  • 15. Perch Editable Regions To start managing content on a page, add a Perch page function to that page. This page function is a Perch editable region. It looks like this: <section class="slide reverse"> <div class="hero"> <h1>Our Cats</h1> <h2>by Harrison Weir</h2> </div> </section>
  • 16. Perch Editable Regions To start managing content on a page, add a Perch page function to that page. This page function is a Perch editable region. It looks like this: <section class="slide reverse"> <div class="hero"> <h1><?php perch_content('Heading'); ?></h1> <h2>by Harrison Weir</h2> </div> </section>
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. Perch Templates Perch templates contain a mix of markup and Perch template tags. Perch templates define and format editable region content: • Admin interface • Data schema • Markup
  • 23. Default Templates By default, Perch comes with the following content templates. These are just the starting point! • Text • File • Image • Code Block • Text Block • Google Analytics • Map • Article
  • 24. A Simple Perch Template The default Text template contains a single Perch template tag of type="text", and no markup. A Text template controls the “Our Cats” Heading region. <perch:content id="text" label="Text" type="text" required="true" title="true" />
  • 25.
  • 26. Anatomy of a Perch Template Tag A Perch template tag opens with perch:content and requires id, label, and type attributes. <perch:content id="text" label="Text" type="text" required="true" title="true" />
  • 27. A more complex, but typical, Template This is a portion of the default Article template. It contains a mix of Perch template tags and markup. <h2><perch:content id="heading" type="text" label="Heading" required="true" title="true" /></h2> <p class="date"><perch:content id="date" type="date" label="Date" format="%d %B %Y" required="true" /></ p> <perch:content id="body" type="textarea" label="Body" markdown="true" editor="markitup" required="true" /> <p class="vcard"> &copy; <perch:content id="date" type="date" label="Date" format="Y" /> <span class="fn n"> <perch:content id="author_given_name" type="text" label="Author given name" /> <perch:content id="author_family_name" type="text" label="Author family name" /> </span> </p>
  • 28. A more complex, but typical, Template This is a portion of the default Article template. It contains a mix of Perch template tags and markup. <h2><perch:content id="heading" type="text" label="Heading" required="true" title="true" /></h2> <p class="date"><perch:content id="date" type="date" label="Date" format="%d %B %Y" required="true" /></ p> <perch:content id="body" type="textarea" label="Body" markdown="true" editor="markitup" required="true" /> <p class="vcard"> &copy; <perch:content id="date" type="date" label="Date" format="Y" /> <span class="fn n"> <perch:content id="author_given_name" type="text" label="Author given name" /> <perch:content id="author_family_name" type="text" label="Author family name" /> </span> </p>
  • 29.
  • 30. An “Opinion” Region Our “Opinion” region will contain a mix of content and markup, courtesy of the Article template. <?php include('perch/runtime.php');?> <!doctype html> <html lang="en"> <head> <title>Our Cats</title> </head> <body> … <section class="opinion"> <h1>Opinion</h1> <h2>Regarding the National Cat Club</h2> <p class="date">15 June 2015</p> <p>In my former edition of “Our Cats,” I wrote hopefully and expectantly of much good to be derived from the institution of the so-called National Cat Club…</p> <p class="vcard">&copy; 2015 <span class="fn n">Harrison Weir, F.H.S.</span></p> </section>
  • 31. An “Opinion” Region Our “Opinion” region will contain a mix of content and markup, courtesy of the Article template. <?php include('perch/runtime.php');?> <!doctype html> <html lang="en"> <head> <title>Our Cats</title> </head> <body> … <section class="opinion"> <h1>Opinion</h1> <?php perch_region('Opinion'); ?> </section>
  • 32.
  • 33.
  • 34.
  • 35. <?php include('perch/runtime.php');?> <!doctype> <html lang="en"> <head> <title>Our Cats</title> </head> <h2><perch:content id="heading" type="text" label="Heading" required="true" title="true" /></h2> <p class="date"><perch:content id="date" type="date" label="Date" format="%d %B %Y" required="true" /></ p> <perch:content id="body" type="textarea" label="Body" markdown="true" editor="markitup" required="true" /> <p class="vcard"> &copy; <perch:content id="date" type="date" label="Date" format="Y" /> <span class="fn n"> <perch:content id="author_given_name" type="text" label="Author given name" /> <perch:content id="author_family_name" type="text" label="Author family name" /> </span> </p>
  • 36. Perch Tag Types By default, Perch comes with the following tag types. • text • smarttext • textarea • date • select • radio • checkbox • image • file • slug • hidden • map • composite • dataselect
  • 37. Perch Region Options Region options are controlled through the Perch Dashboard. • Multiple Item Regions • Shared Regions
  • 38. Multiple Item Regions Allows your editors to add multiple items, simple or complex, to a region. EDITING OPTIONS • All on one page (best for simple items) • List /detail mode (best for complex items) DISPLAY OPTIONS • Customize sort order • Control number of items displayed
  • 39.
  • 40. Title Text Allow multiple items in a region.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48. Shared Regions Shared regions allow you to edit content for multiple pages in a single place.
  • 49.
  • 50. Shared Regions Shared regions are useful for footer text, contact information, or other global content. <footer> <p> Read the complete <em>Our Cats and All About Them</em> at <a href="http://www.gutenberg.org/">Project Gutenberg</a>. </p> </footer>
  • 51. Shared Regions Shared regions are useful for footer text, contact information, or other global content. <footer> <?php perch_region('Footer');> </footer>
  • 52.
  • 53.
  • 54.
  • 55.
  • 57.
  • 58.
  • 59. .
  • 60. Template Options Useful options for your template code. • Repeaters • Blocks
  • 61. Repeaters When you don’t know how many of something you need to manage in a content item, when editors need the option to add lots or none at all, use a repeater! • Images • Documents • Related links • Versions of a downloadable thing • ?
  • 62. Anatomy of a Repeater A Perch repeater tag opens with perch:repeater. It requires an id and a label attribute. An optional max attribute puts a cap on the number of somethings. <ul> <perch:repeater id="links" label="Related Links" max="10"> <li><a href="<perch:content id="url" type="text" label="URL" />"><perch:content type="text" id="desc" label="Link Text" /></a></li> </perch:repeater> </ul>
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68. A job for Perch conditional tags!
  • 69. Perch Conditional Tags, in Brief <perch:before> and <perch:after> contain the parts of our template that should only display if items have been added to the repeater. <perch:repeater id="links" label="Related Links" max="10"> <perch:before> <div class="related-links"> <h3>Related Links</h3> <ul> </perch:before> <li><a href="<perch:content id="url" type="text" label="URL" />"><perch:content type="text" id="desc" label="Link Text" /></a></li> <perch:after> </ul> </div> </perch:after> </perch:repeater>
  • 70.
  • 71. Blocks Perch Blocks in your content template code give content editors a choice of multiple content formatting options. Each Block is like a micro-template inside of your content template. • Can feature custom markup for different content or layout scenarios • Can contain repeaters and conditionals
  • 72. Blocks Blocks exist within a <perch:blocks> tag pair. Template tags and markup for each block exist within a <perch:block> tag pair. <perch:block> tags require type and label attributes. <perch:blocks> <perch:block type="text" label="Text"> … </perch:block> <perch:block type="quote" label="Quote"> … </perch:block> <perch:block type="image" label=“Big image"> … </perch:block> <perch:block type="image" label=“Inline image"> … </perch:block> </perch:blocks>
  • 73. Blocks <perch:blocks> <perch:block type="text" label="Text"> … </perch:block> <perch:block type="quote" label="Quote"> … </perch:block> <perch:block type="image" label=“Big image"> … </perch:block> <perch:block type="image" label=“Inline image"> … </perch:block> </perch:blocks> Blocks exist within a <perch:blocks> tag pair. Template tags and markup for each block exist within a <perch:block> tag pair. <perch:block> tags require type and label attributes.
  • 74. Example: 
 Photo Essay Template with Blocks <div class="photo-essay"> <header style="background:url('<perch:content id="heading_image" type="image" width="1600" label="Heading Image" />') center center no- repeat; background-size:cover;"> <h1><perch:content id="heading" type="text" label="Heading" required="true" title="true" / ></h1> </header> <perch:blocks> … </perch:blocks> </div> A custom template with blocks for text, pull quotes, big images, and inline images.
  • 75. Example: 
 Photo Essay Template with Blocks <perch:block type="text" label="Text"> <perch:content id="text" type="textarea" markdown="true" editor="markitup" size="s" label="Text" /> </perch:block> <perch:block type="pullquote" label="Pull quote"> <blockquote> <perch:content id="quote" type="textarea" markdown="true" size="xs" label="Quote" /> <cite>&mdash; <perch:content id="cite" type="smarttext" label="By" /></cite> </blockquote> </perch:block> <perch:block type="image" label="Big image"> <figure class="hero"> <img src="<perch:content id="image" type="image" width="1600" label="Image" />" class="img-responsive" /> <figcaption><perch:content id="caption" type="smarttext" label="Caption" /></figcaption> </figure> </perch:block> <perch:block type="inlineimage" label="Inline image"> <figure class="inline <perch:content id="class" type="select" options="Pull left|pull-left,Pull right|pull-right" label="Alignment" order="2" />"> <img src="<perch:content id="image" type="image" width="360" density="2" label="Image" order="1" />" class="img-responsive" /> </figure> </perch:block> A custom template with blocks for text, pull quotes, big images, and inline images.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81. Perch Demo Photo Essay with Blocks ADMIN · DISPLAY
  • 82. List / Detail Pages Creating this common website pattern in Perch requires the following: • A detail view content template that includes a slug field • A list view content template • A multiple item content region • The <?php perch_content_custom(); ?> function in your page
  • 83.
  • 84. Detail template This is the master template. It controls the admin and the individual news item view. The existing article template is included with <perch:template>. <perch:template path="content/article.html" /> <perch:content id="slug" for="heading" type="slug" suppress="true" />
  • 85. Detail template The slug field type makes a URL-friendly version of our news title for linking. The suppress="true" attribute hides this field from the admin. <perch:template path="content/article.html" /> <perch:content id="slug" for="heading" type="slug" suppress="true" />
  • 86. List template The list template references content ids defined in the detail template and contains the markup for our list view. <h2> <a href="?s=<perch:content id="slug" type="slug" />"> <perch:content id="heading" type="text" /> </a> </h2> <perch:content id="body" type="textarea" words="20" append="..." /> <p> <a href="?s=<perch:content id="slug" type="slug" />"> Read More &raquo; </a> </p>
  • 87. Initialize a 
 multi-item region Back in our page, we’ll create our region programmatically, using perch_content_create. This takes care of our region initialization and settings in one go. <?php perch_content_create('News', array( 'template' => 'custom/detail.html', 'multiple' => true, 'edit-mode' => 'listdetail', )); ?>
  • 88. List/detail code Also in our page, we use the Perch helper function perch_get() to check for and get the slug from the URL. <?php if (perch_get('s')) { perch_content_custom('News', array( 'template' => 'custom/detail.html', 'filter' => 'slug', 'match' => 'eq', 'value' => perch_get('s'), 'count' => 1, 'paginate'=>true )); } else { perch_content_custom('News', array( 'template' => 'custom/list.html' )); } ?>
  • 89. List/detail code If a slug exists, perch_content_custom displays a slug match with our detail template. Otherwise, it displays all items with the list template. <?php if (perch_get('s')) { perch_content_custom('News', array( 'template' => 'custom/detail.html', 'filter' => 'slug', 'match' => 'eq', 'value' => perch_get('s'), 'count' => 1, 'paginate'=>true )); } else { perch_content_custom('News', array( 'template' => 'custom/list.html' )); } ?>
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95. Limitations of Perch If your site is very content-heavy, you might find Perch an awkward fit for the following reasons: • Every page requires a corresponding file on the server • Multi-item regions are versioned at the region level • All content must be associated with a specific page
  • 97. Perch Runway • Pages no longer need to be a file on the server • Collections - Content is no longer tied to a page - Content can be edited anywhere that makes sense - Items are individually versioned - Collections can have relationships to other Collections
  • 98. Perch Runway Runway features enterprise-y stuff that might be overkill for smaller sites. • Multiple page routes • Task scheduling • CDN delivery • Cloud Storage • Backup to the Cloud or Dropbox • Varnish support
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110.
  • 111. Collections Collections are not tied to any page, instead they are managed via the Collections menu.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119.
  • 120.
  • 121.
  • 122.
  • 123.
  • 124. Collections While not tied to a page, Collections can be associated with any (or all!) pages that would make sense to your content editors.
  • 125.
  • 126.
  • 127.
  • 128.
  • 129.
  • 130.
  • 131. Relationships Collections can have relationships to other Collections. Related Collection content can then be displayed alongside the content for a different Collection.
  • 132.
  • 133.
  • 134.
  • 135. Relationships The <perch:related> tag in your content template enables you to create relationships between Collections, then display that related content. <perch:related id="author" collection="Authors" label="Author"> <perch:before> <h3>Authored by</h3> <ul> </perch:before> <li><a href="/authors/<perch:content id="slug" type="slug" />"><perch:content id="author_first_name" type="text" /> <perch:content id="author_last_name" type="text" /></a></li> <perch:after> </ul> </perch:after> </perch:related>
  • 136.
  • 137.
  • 138.
  • 139.
  • 140.
  • 141.
  • 142.
  • 143. End.