SlideShare a Scribd company logo
1 of 36
Add even richer interaction to
your site - plone.patternslib
Plone Conference 2016, Boston
Wolfgang Thomas
pysailor_de
pysailor
Patternslib, what is it?
“A library of reusable patterns which let you create rich, dynamic
and interactive prototypes or websites, without having to know or
care about Javascript”
A designer / integrator adds a class to their markup, and "magic
things" happen.
<div class="pat-collapsible closed">
<p>Check this out</p>
<p>Text that will appear on click</p>
<div>
Excellent overview by JC Brand from #ploneconf2015
https://www.youtube.com/watch?v=qTmkT7vFTT8
Patterns & Plone
Mockup, part of Plone 5
• Started as an early fork of Patternslib
• Has some very Plone-specific patterns (Resource registry,
theme mapper)
• Shares base pattern with Patternslib, still different parser
• Conflicts with some Patternslib patterns
History of Mockup and Patternslib, also by JC Brand
https://www.youtube.com/watch?v=acuo0P5-H3Q
plone.patternslib
• Add-on for bringing Patternslib to Plone
• Still in an early stage, but ready to use
• Comes with some handy examples (browser views):
• @@pat-switch
• @@pat-inject
• etc
Resources
Patternslib
• URL: http://patternslib.com/
• The core package
• Can be used outside of Plone, too. Think: github
pages and jekyll...
Resources
plone.patternslib
• URL: https://github.com/plone/plone.patternslib
• Integration of most Patterns into Plone
Resources
Mockup
• URL: http://plone.github.io/mockup
• Part of Plone 5
Resources
How did I create those tabs in the plain Plone page?
pat-stacks
<nav>
<a href="#patternslib">Patternslib</a> |
<a href="#plone">plone.patternslib</a>
</nav>
<article class="pat-stacks">
<section id="patternslib">...</section>
<section id="plone">...</section>
</article>
Documentation: http://patternslib.com/stacks/#documentation
Let's see some real action!
Example: A custom application for ACME
Corporation
Global manufacturer of goods
The challenge
Keep track of their suppliers
• They're spread all over the world, and contribute to
ACME's various production plants.
• Once in a while, they get audited.
• There can be multiple audit reports per supplier.
• Custom content types, yay! No problem for Plone.
Plus: “make it look nice”
Overview and quick-search
Keeping track of a long list of suppliers
• Dig your way through a long listing
• Or, just type a few letters for ACME KwikSearch...
Submit on change
Submit on change
With pat-autosubmit the form is submitted on every change.
<form
class="pat-autosubmit"
action="suppliers-listing"
method="POST">
<input type="search"
placeholder="Search suppliers"
name="Title">
</form>
But reloading is so 2006!
We can do better, surely!
Using injection
We use pat-inject to re-insert the search results into
an element with id “suppliers".
<form
class="pat-inject pat-autosubmit"
action="my-view-name#suppliers"
method="POST">
Using injection
All results are displayed in a <div> with id "suppliers".
<div id="suppliers">
<div tal:repeat="supplier view/suppliers">
Display title and description...
</div>
</div>
Take a good look at the documentation:
http://patternslib.com/inject/
Using injection
But where's the "nice"?
Also here Patternslib can help us.
And we need a little bit of CSS (which we can copy
from Patternslib!)
Masonry
Masonry
Using pat-masonry and some custom CSS, the results are
displayed in neat little boxes.
<div
id="suppliers"
class="tiles pat-masonry"
data-pat-masonry="item-selector: .tile">
<div tal:repeat="supplier view/suppliers"
class="tile four columns">
Display title and description...
</div>
</div>
Overview table with search
It's about the content!
I want to see the results of the reports immediately.
We need a good filter
Think “Advanced Search”
Auto-suggest with fixed values
We use pat-autosuggest to create a "select2" widget.
<input class="pat-autosuggest"
type="text" name="plant"
data-pat-autosuggest='
words-json: ${view/plant_names_json};
allow-new-words: false;'
placeholder="Plant">
The list of values is fixed, therefore we use
allow-new-words: false.
Auto-suggest with fixed values
The parameters for "words-json" are a simple json
dict:
{"grnspn": "Gru00fcnspan Alley Copper Works",
"ivy": "Ivy Plaza Greenery",
"rdgrd": "Ru00f8dgru00f8d Road Explosives",
"sherwood": "Sherwood Forest Lumber”}
This is just one way of providing the “vocabulary”.
Documentation: http://patternslib.com/auto-suggest/
Auto-suggest with limit
pat-autosuggest comes with several options, such as
<input class="pat-autosuggest"
type="text" name="audit_type"
data-pat-autosuggest='
words-json: ${view/audit_types_json};
allow-new-words: false;
max-selection-size: 1'
>
The user can only pick one entry at a time.
We can haz Mockup, too!
Here, we use the Mockup pattern pat-pickaday.
Peaceful coexistence is possible! (But, it depends...)
<input name="from"
class="pat-pickadate"
data-pat-pickadate="time:false"
value="${view/default_from}"
/>
Depending on other input
Now it gets a little crazy...
Results "Pass", "Conditional pass" & "Fail" need to
have different labels, depending on the type of audit.
Audit-Type Pass Cond. Pass Fail
Financial Pass (C) Cond. Pass (B) Fail (A)
Operational Green Red Yellow
Internal / Investigative A B C
Depending on other input
z3c.form with custom field for Audit result
Depending on other input
With pat-depends we show or hide <select> fields based on the user's choice for
"Audit type". The example below shows the case for audit type "Operational".
<select
class="pat-depends"
disabled="disabled"
name="form.widgets.audit_result:list"
data-pat-depends="
condition:form-widgets-audit_type=operational
action:both"
>
<option value="pass" selected="selected">Green</option>
<option value="conditional">Yellow</option>
<option value="fail">Red</option>
</select>
Depending on other input
For every variant, we define a <select> field with the
desired options. Those fields are initially set to
disabled (and thereby hidden).
Only if the condition is true will the field be 1) shown
and 2) enabled (action: both).
Several dependency expression options are available
(Equals, lower than, is not, substring, etc.)
Documentation: http://patternslib.com/depends/
Advanced Usage
Quaive (Plone Intranet)
Where to begin? Patterns are used all over the place!
Advanced Usage
OiRA - Online interactive Risk Assessment
Plone 4 based application that also uses Patterns all
over the place.
The future: More Patterns for
everybody!
Goals
• Unify duplicated patterns (*)
• Move generic Mockup patterns to Patternslib
• Full Patternslib integration in Plone (PLIP?)
• Update documentation
• [...]
• Profit!
(*) Double / incompatible
• Both in Mockup and Patternslib
• pat-tooltip
• pat-toggle
• pat-inject vs pat-contentload
• pat-autosuggest vs pat-select2
• and some more

More Related Content

What's hot

Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examplesSeb Rose
 
Form Validation NG
Form Validation NGForm Validation NG
Form Validation NGjoaopmaia
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and ToolsBob Paulin
 
HTML5 e Css3 - 7 | WebMaster & WebDesigner
HTML5 e Css3 - 7 | WebMaster & WebDesignerHTML5 e Css3 - 7 | WebMaster & WebDesigner
HTML5 e Css3 - 7 | WebMaster & WebDesignerMatteo Magni
 
Forms With Ajax And Advanced Plugins
Forms With Ajax And Advanced PluginsForms With Ajax And Advanced Plugins
Forms With Ajax And Advanced PluginsManuel Lemos
 
Bridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous DeliveryBridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous Deliverymasoodjan
 
Producing Testable Requirements
Producing Testable RequirementsProducing Testable Requirements
Producing Testable RequirementsIntergen
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 
Node.js exception handling
Node.js exception handlingNode.js exception handling
Node.js exception handlingMinh Hoang
 
Automated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and PitfallsAutomated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and PitfallsWyn B. Van Devanter
 

What's hot (12)

Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examples
 
Form Validation NG
Form Validation NGForm Validation NG
Form Validation NG
 
The Testing Planet - July 2010
The Testing Planet - July 2010The Testing Planet - July 2010
The Testing Planet - July 2010
 
Testable requirements
Testable requirementsTestable requirements
Testable requirements
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and Tools
 
HTML5 e Css3 - 7 | WebMaster & WebDesigner
HTML5 e Css3 - 7 | WebMaster & WebDesignerHTML5 e Css3 - 7 | WebMaster & WebDesigner
HTML5 e Css3 - 7 | WebMaster & WebDesigner
 
Forms With Ajax And Advanced Plugins
Forms With Ajax And Advanced PluginsForms With Ajax And Advanced Plugins
Forms With Ajax And Advanced Plugins
 
Bridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous DeliveryBridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous Delivery
 
Producing Testable Requirements
Producing Testable RequirementsProducing Testable Requirements
Producing Testable Requirements
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Node.js exception handling
Node.js exception handlingNode.js exception handling
Node.js exception handling
 
Automated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and PitfallsAutomated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and Pitfalls
 

Viewers also liked

Μικροί ήρωες στη μεγάλη οθόνη
Μικροί ήρωες στη μεγάλη οθόνηΜικροί ήρωες στη μεγάλη οθόνη
Μικροί ήρωες στη μεγάλη οθόνηParashos Tsouros
 
Introduction to Python for Plone developers
Introduction to Python for Plone developersIntroduction to Python for Plone developers
Introduction to Python for Plone developersJim Roepcke
 
How to Get Started Theming Plone
How to Get Started Theming PloneHow to Get Started Theming Plone
How to Get Started Theming Plonecdw9
 
Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014Rob Gietema
 
Faceted navigation in Plone 5
Faceted navigation in Plone 5Faceted navigation in Plone 5
Faceted navigation in Plone 5Alin Voinea
 
New EEA Plone Add-ons
New EEA Plone Add-onsNew EEA Plone Add-ons
New EEA Plone Add-onsAlin Voinea
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 themingsneridagh
 
Unknown plone
Unknown ploneUnknown plone
Unknown plonecdw9
 
Plone 5 theming unleashed
Plone 5 theming unleashedPlone 5 theming unleashed
Plone 5 theming unleashedsneridagh
 
Plone Intranet under the hood
Plone Intranet under the hoodPlone Intranet under the hood
Plone Intranet under the hoodGuido Stevens
 
The state of Plone Intranet
The state of Plone IntranetThe state of Plone Intranet
The state of Plone IntranetGuido Stevens
 

Viewers also liked (11)

Μικροί ήρωες στη μεγάλη οθόνη
Μικροί ήρωες στη μεγάλη οθόνηΜικροί ήρωες στη μεγάλη οθόνη
Μικροί ήρωες στη μεγάλη οθόνη
 
Introduction to Python for Plone developers
Introduction to Python for Plone developersIntroduction to Python for Plone developers
Introduction to Python for Plone developers
 
How to Get Started Theming Plone
How to Get Started Theming PloneHow to Get Started Theming Plone
How to Get Started Theming Plone
 
Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014Resource Registries: Plone Conference 2014
Resource Registries: Plone Conference 2014
 
Faceted navigation in Plone 5
Faceted navigation in Plone 5Faceted navigation in Plone 5
Faceted navigation in Plone 5
 
New EEA Plone Add-ons
New EEA Plone Add-onsNew EEA Plone Add-ons
New EEA Plone Add-ons
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
 
Unknown plone
Unknown ploneUnknown plone
Unknown plone
 
Plone 5 theming unleashed
Plone 5 theming unleashedPlone 5 theming unleashed
Plone 5 theming unleashed
 
Plone Intranet under the hood
Plone Intranet under the hoodPlone Intranet under the hood
Plone Intranet under the hood
 
The state of Plone Intranet
The state of Plone IntranetThe state of Plone Intranet
The state of Plone Intranet
 

Similar to Add even richer interaction to your site - plone.patternslib

Supercharging your Organic CTR
Supercharging your Organic CTRSupercharging your Organic CTR
Supercharging your Organic CTRPhil Pearce
 
Atlanta user group presentation configero 8 nov11
Atlanta user group presentation configero 8 nov11Atlanta user group presentation configero 8 nov11
Atlanta user group presentation configero 8 nov11vraopolisetti
 
Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3masahiroookubo
 
SharePoint 2010 Content Query Web Part
SharePoint 2010 Content Query Web PartSharePoint 2010 Content Query Web Part
SharePoint 2010 Content Query Web PartKim Frehe
 
I one aolpage-test-2010
I one aolpage-test-2010I one aolpage-test-2010
I one aolpage-test-2010Nicholas Tang
 
The What & Why of Pattern Lab
The What & Why of Pattern LabThe What & Why of Pattern Lab
The What & Why of Pattern LabDave Olsen
 
Optimizely Developer Showcase
Optimizely Developer ShowcaseOptimizely Developer Showcase
Optimizely Developer ShowcaseOptimizely
 
django_introduction20141030
django_introduction20141030django_introduction20141030
django_introduction20141030Kevin Wu
 
SMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsSMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsAmazon Web Services
 
Meet Process Design
Meet Process DesignMeet Process Design
Meet Process DesignAlan Crean
 
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08Tim Stephenson
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)SANTOSH RATH
 
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce Configero
 
Automate your functional testing
Automate your functional testingAutomate your functional testing
Automate your functional testingYasui Tsutomu
 
Angular js quickstart
Angular js quickstartAngular js quickstart
Angular js quickstartLinkMe Srl
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Ondřej Machulda
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesTikal Knowledge
 
Take Your XPages Development to the Next Level
Take Your XPages Development to the Next LevelTake Your XPages Development to the Next Level
Take Your XPages Development to the Next Levelbalassaitis
 
AEM Sightly Deep Dive
AEM Sightly Deep DiveAEM Sightly Deep Dive
AEM Sightly Deep DiveGabriel Walt
 

Similar to Add even richer interaction to your site - plone.patternslib (20)

Supercharging your Organic CTR
Supercharging your Organic CTRSupercharging your Organic CTR
Supercharging your Organic CTR
 
Atlanta user group presentation configero 8 nov11
Atlanta user group presentation configero 8 nov11Atlanta user group presentation configero 8 nov11
Atlanta user group presentation configero 8 nov11
 
Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3
 
SharePoint 2010 Content Query Web Part
SharePoint 2010 Content Query Web PartSharePoint 2010 Content Query Web Part
SharePoint 2010 Content Query Web Part
 
dbadapters
dbadaptersdbadapters
dbadapters
 
I one aolpage-test-2010
I one aolpage-test-2010I one aolpage-test-2010
I one aolpage-test-2010
 
The What & Why of Pattern Lab
The What & Why of Pattern LabThe What & Why of Pattern Lab
The What & Why of Pattern Lab
 
Optimizely Developer Showcase
Optimizely Developer ShowcaseOptimizely Developer Showcase
Optimizely Developer Showcase
 
django_introduction20141030
django_introduction20141030django_introduction20141030
django_introduction20141030
 
SMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step FunctionsSMC304 Serverless Orchestration with AWS Step Functions
SMC304 Serverless Orchestration with AWS Step Functions
 
Meet Process Design
Meet Process DesignMeet Process Design
Meet Process Design
 
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
 
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
URL Hacking 101: An Easy Way to Streamline Processes in Salesforce
 
Automate your functional testing
Automate your functional testingAutomate your functional testing
Automate your functional testing
 
Angular js quickstart
Angular js quickstartAngular js quickstart
Angular js quickstart
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
 
Take Your XPages Development to the Next Level
Take Your XPages Development to the Next LevelTake Your XPages Development to the Next Level
Take Your XPages Development to the Next Level
 
AEM Sightly Deep Dive
AEM Sightly Deep DiveAEM Sightly Deep Dive
AEM Sightly Deep Dive
 

Recently uploaded

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
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
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
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
 
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
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
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
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
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
 
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
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
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
 
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
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
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
 

Recently uploaded (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
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 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
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
 
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...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
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
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
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
 
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 ...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
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
 
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 ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
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
 

Add even richer interaction to your site - plone.patternslib

  • 1. Add even richer interaction to your site - plone.patternslib Plone Conference 2016, Boston Wolfgang Thomas pysailor_de pysailor
  • 2. Patternslib, what is it? “A library of reusable patterns which let you create rich, dynamic and interactive prototypes or websites, without having to know or care about Javascript” A designer / integrator adds a class to their markup, and "magic things" happen. <div class="pat-collapsible closed"> <p>Check this out</p> <p>Text that will appear on click</p> <div> Excellent overview by JC Brand from #ploneconf2015 https://www.youtube.com/watch?v=qTmkT7vFTT8
  • 3. Patterns & Plone Mockup, part of Plone 5 • Started as an early fork of Patternslib • Has some very Plone-specific patterns (Resource registry, theme mapper) • Shares base pattern with Patternslib, still different parser • Conflicts with some Patternslib patterns History of Mockup and Patternslib, also by JC Brand https://www.youtube.com/watch?v=acuo0P5-H3Q
  • 4. plone.patternslib • Add-on for bringing Patternslib to Plone • Still in an early stage, but ready to use • Comes with some handy examples (browser views): • @@pat-switch • @@pat-inject • etc
  • 5. Resources Patternslib • URL: http://patternslib.com/ • The core package • Can be used outside of Plone, too. Think: github pages and jekyll...
  • 8. Resources How did I create those tabs in the plain Plone page? pat-stacks <nav> <a href="#patternslib">Patternslib</a> | <a href="#plone">plone.patternslib</a> </nav> <article class="pat-stacks"> <section id="patternslib">...</section> <section id="plone">...</section> </article> Documentation: http://patternslib.com/stacks/#documentation
  • 9. Let's see some real action! Example: A custom application for ACME Corporation Global manufacturer of goods
  • 10. The challenge Keep track of their suppliers • They're spread all over the world, and contribute to ACME's various production plants. • Once in a while, they get audited. • There can be multiple audit reports per supplier. • Custom content types, yay! No problem for Plone. Plus: “make it look nice”
  • 11. Overview and quick-search Keeping track of a long list of suppliers • Dig your way through a long listing • Or, just type a few letters for ACME KwikSearch...
  • 13. Submit on change With pat-autosubmit the form is submitted on every change. <form class="pat-autosubmit" action="suppliers-listing" method="POST"> <input type="search" placeholder="Search suppliers" name="Title"> </form>
  • 14. But reloading is so 2006! We can do better, surely!
  • 15. Using injection We use pat-inject to re-insert the search results into an element with id “suppliers". <form class="pat-inject pat-autosubmit" action="my-view-name#suppliers" method="POST">
  • 16. Using injection All results are displayed in a <div> with id "suppliers". <div id="suppliers"> <div tal:repeat="supplier view/suppliers"> Display title and description... </div> </div> Take a good look at the documentation: http://patternslib.com/inject/
  • 18. But where's the "nice"? Also here Patternslib can help us. And we need a little bit of CSS (which we can copy from Patternslib!)
  • 20. Masonry Using pat-masonry and some custom CSS, the results are displayed in neat little boxes. <div id="suppliers" class="tiles pat-masonry" data-pat-masonry="item-selector: .tile"> <div tal:repeat="supplier view/suppliers" class="tile four columns"> Display title and description... </div> </div>
  • 21. Overview table with search It's about the content! I want to see the results of the reports immediately.
  • 22. We need a good filter Think “Advanced Search”
  • 23. Auto-suggest with fixed values We use pat-autosuggest to create a "select2" widget. <input class="pat-autosuggest" type="text" name="plant" data-pat-autosuggest=' words-json: ${view/plant_names_json}; allow-new-words: false;' placeholder="Plant"> The list of values is fixed, therefore we use allow-new-words: false.
  • 24. Auto-suggest with fixed values The parameters for "words-json" are a simple json dict: {"grnspn": "Gru00fcnspan Alley Copper Works", "ivy": "Ivy Plaza Greenery", "rdgrd": "Ru00f8dgru00f8d Road Explosives", "sherwood": "Sherwood Forest Lumber”} This is just one way of providing the “vocabulary”. Documentation: http://patternslib.com/auto-suggest/
  • 25. Auto-suggest with limit pat-autosuggest comes with several options, such as <input class="pat-autosuggest" type="text" name="audit_type" data-pat-autosuggest=' words-json: ${view/audit_types_json}; allow-new-words: false; max-selection-size: 1' > The user can only pick one entry at a time.
  • 26. We can haz Mockup, too! Here, we use the Mockup pattern pat-pickaday. Peaceful coexistence is possible! (But, it depends...) <input name="from" class="pat-pickadate" data-pat-pickadate="time:false" value="${view/default_from}" />
  • 27. Depending on other input Now it gets a little crazy... Results "Pass", "Conditional pass" & "Fail" need to have different labels, depending on the type of audit. Audit-Type Pass Cond. Pass Fail Financial Pass (C) Cond. Pass (B) Fail (A) Operational Green Red Yellow Internal / Investigative A B C
  • 28. Depending on other input z3c.form with custom field for Audit result
  • 29. Depending on other input With pat-depends we show or hide <select> fields based on the user's choice for "Audit type". The example below shows the case for audit type "Operational". <select class="pat-depends" disabled="disabled" name="form.widgets.audit_result:list" data-pat-depends=" condition:form-widgets-audit_type=operational action:both" > <option value="pass" selected="selected">Green</option> <option value="conditional">Yellow</option> <option value="fail">Red</option> </select>
  • 30. Depending on other input For every variant, we define a <select> field with the desired options. Those fields are initially set to disabled (and thereby hidden). Only if the condition is true will the field be 1) shown and 2) enabled (action: both). Several dependency expression options are available (Equals, lower than, is not, substring, etc.) Documentation: http://patternslib.com/depends/
  • 31. Advanced Usage Quaive (Plone Intranet) Where to begin? Patterns are used all over the place!
  • 32.
  • 33. Advanced Usage OiRA - Online interactive Risk Assessment Plone 4 based application that also uses Patterns all over the place.
  • 34.
  • 35. The future: More Patterns for everybody! Goals • Unify duplicated patterns (*) • Move generic Mockup patterns to Patternslib • Full Patternslib integration in Plone (PLIP?) • Update documentation • [...] • Profit!
  • 36. (*) Double / incompatible • Both in Mockup and Patternslib • pat-tooltip • pat-toggle • pat-inject vs pat-contentload • pat-autosuggest vs pat-select2 • and some more