SlideShare a Scribd company logo
1 of 32
Download to read offline
CRAFT CMS 3.3
GOING HEADLESS WITH
CHARLOTTE CRAFT CMS MEETUP - OCT. 8 2019
WELCOME
THANK YOU
PROVIDING MEETING SPACE PROVIDING FOOD & BEVERAGES
AGENDA
• What is Headless?
• How can Craft help?
• Popular uses.
• Let’s see some stuff!
• Some recent updates.
• Wrap Up and Free Links!
WHAT
IS
HEADLESS?
“WITH A HEADLESS APPROACH THERE IS NO FRONTEND OUT OF THE BOX”
WHAT IS HEADLESS?
• Decoupling.
• Static site (JAM stack.)
• Benefits:
• Performance,
• Security,
• Scalability,
• Portability.
HOW
CAN
CRAFT
HELP?
+
“CRAFT CMS, TODAY, IS YOUR BEST OPTION FOR A HEADLESS CMS.”
HOW CAN CRAFT HELP?
• GraphQL Built In (Craft 3.3.)
• Element API (JSON if you need it.)
• Live Preview, Headless!
• Streamlined Admin:
• Removes routes and urls*,
• Allows singles without urls,
• Queries are optimized.
+
POPULAR
USES
FOR
HEADLESS
WEB APPS.
POPULAR USES FOR HEADLESS WEB APPS.
• SPA/PWA (Vue, React, Angular.)
• Static Site Generators:
• Gatsby, Gridsome.
• Host on CHEAP servers.
• Data available for Social Feeds.
• Large Data Pipeline:
• Content Warehouses,
• Search Engine Data Stores,
• iOS & Android Data Stores.
LET’S
SEE
SOME
STUFF!
AUTO-COMPLETE SEARCH
• Frontend Tooling:
• VueJS (Handles views, routing, etc.)
• Axios (JS library for http requests)
• Bootstrap 4 (just for examples)
• Backend Tooling
• GraphQL in Craft CMS
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
”
“
— Andrew Welch, NYStudio107
WITH VUEJS, THE DOM IS A
SIDE-EFFECT OF YOUR DATA,
NOT THE OTHER WAY AROUND.
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
• VueJS Instance
• searchApi (the Axios instance
we will use to send & receive
GraphQL via http.)
• searchQuery (the search string
the user is looking for.)
• searchResults (object of
results if any of the search.)
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
• configureApi() function:
• Returns a config object that we
can pass to axios.create() for
our http requests so they all
have the same basic settings.
• Settings to pass in:
• apiUrl = default url CraftQL
listens to for GraphQL
requests.
• apiToken = Bearer tokens to
allow read/write to Craft CMS
(more..)
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
• Bearer Tokens
• Set these in Craft CMS.
• Define their permissions.
• NOT unique to Craft,

needed for ANY GraphQL

usage.
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
• HTML Markup
• {% verbatim %} tag?
• Both Twig and Vue use Mustache.
• Input bound to search query via 

v-model attribute for VueJS.
• Input also bound via v-on:keyup

attribute, allowing query while
user types in input.
• List items with v-for attributes
for results parsing.
• {{ $data }} for easy debugging.
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
• GraphQL for Auto-complete
Search:
• performSearch() function.
• Checks emptiness.
• Set variables for GraphQL query:
• sections = Sections to search
in Craft CMS.
• needle = search string.
(prefixed with searchPrefix.)
• limit = the number of results
we want to return.
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
• Search constants
• searchSections = We only
want to search the Blog
Craft entries section.
• searchPrefix = We want to
narrow our search to the
Title field in those entries.
• searchQuery variable:
• Called via executeQuery()
• Defines query, and names/
types of incoming variables.
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
• searchQuery variable cont…
• GraphQL Schemas/Types
• Strict type system to ensure
purity and correctness of

data being passed into it.
• GraphQL will only return the 

data you tell it to.
• Here we are returning Title
and URL from the queried
entries.
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
• Query callback:
• Runs when query is
successful.
• Set searchResults to subset
of the data returned.

• executeQuery() function:
• Using Axios, send a POST
request to our /api url with
our data.
• .post() returns a Promise
which we use to process
data or errors.
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
AUTO-COMPLETE SEARCH
COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
SOME
RECENT
UPDATES.
SOME RECENT UPDATES
• GraphiQl IDE
• Included in CraftQL
integration.
• Allows you to play around
with queries and syntax with
live results.
• Incredibly handy for
debugging syntax/formatting
issues.
SOME RECENT UPDATES
• Craft Cloud
• PERFECT for Headless.
• Especially cost effective for
smaller clients and pet
projects.
• Should be rolling out Q2
2020 to the public, beta by
EOY 2019.
SOME RECENT UPDATES
• Plugin Support for GraphQL
• SEOMatic.
• Retour.
• More to come…
WRAP
UP
& FREE
LINKS!
WRAP UP AND FREE LINKS
• Craft CMS 3.3 bundles GraphQL and adds some configurable options to tailor the
authoring experience for Headless application support.
• Headless development great for reactive applications where you want and/or need
immediate reactions to user actions.
• Headless development is beneficial to the client by adding security, performance
and data portability to the web application. Clients backend data is decoupled from
frontend frameworks and can be made available to new frameworks, or other data
consumption destinations.
• Craft Cloud coming soon to support cloud-based “serverless” Craft installs.
WRAP UP AND FREE LINKS
• https://nystudio107.com/blog/using-vuejs-graphql-to-make-practical-magic
• https://www.howtographql.com/
• https://craftquest.io/courses/headless-craft/
• https://docs.craftcms.com/v3/dev/headless.html
• https://dev.edenspiekermann.com/2019/01/21/turn-craft-into-a-headless-cms/
• https://cognition.happycog.com/article/going-headless-with-craft-cms
• https://nystudio107.com/blog/headless-preview-in-craft-cms **
THANK YOU
CHARLOTTE CRAFT CMS MEETUP
“TESTING WITH CRAFT 3 TESTING FRAMEWORK”
NEXT MEETUP: WEDNESDAY NOVEMBER 13:
(ALSO UPDATING OUR LOGO BY NEXT MEETUP!)
SLIDESHARE.NET/JUSTINHOLT20/GOING-HEADLESS-WITH-CRAFT-CMS-33

More Related Content

What's hot

Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 years
jduff
 
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Rails
jduff
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
Sébastien Levert
 
Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2
ArangoDB Database
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
Avi Kedar
 

What's hot (20)

Automated Duplicate Content Consolidation with Google Cloud Functions
Automated Duplicate Content Consolidation with Google Cloud FunctionsAutomated Duplicate Content Consolidation with Google Cloud Functions
Automated Duplicate Content Consolidation with Google Cloud Functions
 
Rendering: Or why your perfectly optimized content doesn't rank
Rendering: Or why your perfectly optimized content doesn't rankRendering: Or why your perfectly optimized content doesn't rank
Rendering: Or why your perfectly optimized content doesn't rank
 
Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 years
 
Building a Serverless Pipeline
Building a Serverless PipelineBuilding a Serverless Pipeline
Building a Serverless Pipeline
 
Building a data warehouse with Amazon Redshift … and a quick look at Amazon ...
Building a data warehouse  with Amazon Redshift … and a quick look at Amazon ...Building a data warehouse  with Amazon Redshift … and a quick look at Amazon ...
Building a data warehouse with Amazon Redshift … and a quick look at Amazon ...
 
Presentation kyushu-2018
Presentation kyushu-2018Presentation kyushu-2018
Presentation kyushu-2018
 
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Rails
 
SOA on Rails
SOA on RailsSOA on Rails
SOA on Rails
 
Lambdaless and AWS CDK
Lambdaless and AWS CDKLambdaless and AWS CDK
Lambdaless and AWS CDK
 
Kapil Thangavelu - Cloud Custodian
Kapil Thangavelu - Cloud CustodianKapil Thangavelu - Cloud Custodian
Kapil Thangavelu - Cloud Custodian
 
Firebase presentation
Firebase presentationFirebase presentation
Firebase presentation
 
Orange developers day - Hibernate Search Workshop
Orange developers day - Hibernate Search WorkshopOrange developers day - Hibernate Search Workshop
Orange developers day - Hibernate Search Workshop
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
 
Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2Rupy2012 ArangoDB Workshop Part2
Rupy2012 ArangoDB Workshop Part2
 
Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)
 
Serverless Architecture Patterns - Manoj Ganapathi
Serverless Architecture Patterns - Manoj GanapathiServerless Architecture Patterns - Manoj Ganapathi
Serverless Architecture Patterns - Manoj Ganapathi
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process E...
Using Amazon CloudWatch Events,  AWS Lambda and Spark Streaming  to Process E...Using Amazon CloudWatch Events,  AWS Lambda and Spark Streaming  to Process E...
Using Amazon CloudWatch Events, AWS Lambda and Spark Streaming to Process E...
 
Serverless by examples and case studies
Serverless by examples and case studiesServerless by examples and case studies
Serverless by examples and case studies
 
Building a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 MinutesBuilding a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 Minutes
 

Similar to Going Headless with Craft CMS 3.3

Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
KMS Technology
 

Similar to Going Headless with Craft CMS 3.3 (20)

Mvc 4.0
Mvc 4.0Mvc 4.0
Mvc 4.0
 
Saving Money by Optimizing Your Cloud Add-On Infrastructure
Saving Money by Optimizing Your Cloud Add-On InfrastructureSaving Money by Optimizing Your Cloud Add-On Infrastructure
Saving Money by Optimizing Your Cloud Add-On Infrastructure
 
Presto talk @ Global AI conference 2018 Boston
Presto talk @ Global AI conference 2018 BostonPresto talk @ Global AI conference 2018 Boston
Presto talk @ Global AI conference 2018 Boston
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Logic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIsLogic apps and PowerApps - Integrate across your APIs
Logic apps and PowerApps - Integrate across your APIs
 
Exposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using SwaggerExposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using Swagger
 
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developersChris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
 
Advanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutesAdvanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutes
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
 
Externalizing Authorization in Micro Services world
Externalizing Authorization in Micro Services worldExternalizing Authorization in Micro Services world
Externalizing Authorization in Micro Services world
 
From Kafka to BigQuery - Strata Singapore
From Kafka to BigQuery - Strata SingaporeFrom Kafka to BigQuery - Strata Singapore
From Kafka to BigQuery - Strata Singapore
 
Intro to CakePHP
Intro to CakePHPIntro to CakePHP
Intro to CakePHP
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2Microservices with Apache Camel, Docker and Fabric8 v2
Microservices with Apache Camel, Docker and Fabric8 v2
 
AWS as platform for scalable applications
AWS as platform for scalable applicationsAWS as platform for scalable applications
AWS as platform for scalable applications
 
06 web api
06 web api06 web api
06 web api
 
Serverless Data Prep with AWS Glue (ANT313) - AWS re:Invent 2018
Serverless Data Prep with AWS Glue (ANT313) - AWS re:Invent 2018Serverless Data Prep with AWS Glue (ANT313) - AWS re:Invent 2018
Serverless Data Prep with AWS Glue (ANT313) - AWS re:Invent 2018
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalr
 
BEST REST in OpenStack
BEST REST in OpenStackBEST REST in OpenStack
BEST REST in OpenStack
 

Recently uploaded

Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 

Recently uploaded (20)

Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 

Going Headless with Craft CMS 3.3

  • 1. CRAFT CMS 3.3 GOING HEADLESS WITH CHARLOTTE CRAFT CMS MEETUP - OCT. 8 2019
  • 3. THANK YOU PROVIDING MEETING SPACE PROVIDING FOOD & BEVERAGES
  • 4. AGENDA • What is Headless? • How can Craft help? • Popular uses. • Let’s see some stuff! • Some recent updates. • Wrap Up and Free Links!
  • 6. “WITH A HEADLESS APPROACH THERE IS NO FRONTEND OUT OF THE BOX” WHAT IS HEADLESS? • Decoupling. • Static site (JAM stack.) • Benefits: • Performance, • Security, • Scalability, • Portability.
  • 8. “CRAFT CMS, TODAY, IS YOUR BEST OPTION FOR A HEADLESS CMS.” HOW CAN CRAFT HELP? • GraphQL Built In (Craft 3.3.) • Element API (JSON if you need it.) • Live Preview, Headless! • Streamlined Admin: • Removes routes and urls*, • Allows singles without urls, • Queries are optimized. +
  • 10. POPULAR USES FOR HEADLESS WEB APPS. • SPA/PWA (Vue, React, Angular.) • Static Site Generators: • Gatsby, Gridsome. • Host on CHEAP servers. • Data available for Social Feeds. • Large Data Pipeline: • Content Warehouses, • Search Engine Data Stores, • iOS & Android Data Stores.
  • 12. AUTO-COMPLETE SEARCH • Frontend Tooling: • VueJS (Handles views, routing, etc.) • Axios (JS library for http requests) • Bootstrap 4 (just for examples) • Backend Tooling • GraphQL in Craft CMS COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 13. ” “ — Andrew Welch, NYStudio107 WITH VUEJS, THE DOM IS A SIDE-EFFECT OF YOUR DATA, NOT THE OTHER WAY AROUND. COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 14. AUTO-COMPLETE SEARCH • VueJS Instance • searchApi (the Axios instance we will use to send & receive GraphQL via http.) • searchQuery (the search string the user is looking for.) • searchResults (object of results if any of the search.) COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 15. AUTO-COMPLETE SEARCH • configureApi() function: • Returns a config object that we can pass to axios.create() for our http requests so they all have the same basic settings. • Settings to pass in: • apiUrl = default url CraftQL listens to for GraphQL requests. • apiToken = Bearer tokens to allow read/write to Craft CMS (more..) COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 16. AUTO-COMPLETE SEARCH • Bearer Tokens • Set these in Craft CMS. • Define their permissions. • NOT unique to Craft,
 needed for ANY GraphQL
 usage. COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 17. AUTO-COMPLETE SEARCH • HTML Markup • {% verbatim %} tag? • Both Twig and Vue use Mustache. • Input bound to search query via 
 v-model attribute for VueJS. • Input also bound via v-on:keyup
 attribute, allowing query while user types in input. • List items with v-for attributes for results parsing. • {{ $data }} for easy debugging. COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 18. AUTO-COMPLETE SEARCH • GraphQL for Auto-complete Search: • performSearch() function. • Checks emptiness. • Set variables for GraphQL query: • sections = Sections to search in Craft CMS. • needle = search string. (prefixed with searchPrefix.) • limit = the number of results we want to return. COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 19. AUTO-COMPLETE SEARCH • Search constants • searchSections = We only want to search the Blog Craft entries section. • searchPrefix = We want to narrow our search to the Title field in those entries. • searchQuery variable: • Called via executeQuery() • Defines query, and names/ types of incoming variables. COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 20. AUTO-COMPLETE SEARCH • searchQuery variable cont… • GraphQL Schemas/Types • Strict type system to ensure purity and correctness of
 data being passed into it. • GraphQL will only return the 
 data you tell it to. • Here we are returning Title and URL from the queried entries. COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 21. AUTO-COMPLETE SEARCH • Query callback: • Runs when query is successful. • Set searchResults to subset of the data returned.
 • executeQuery() function: • Using Axios, send a POST request to our /api url with our data. • .post() returns a Promise which we use to process data or errors. COURTESY: HTTPS://NYSTUDIO107.COM/BLOG/USING-VUEJS-GRAPHQL-TO-MAKE-PRACTICAL-MAGIC
  • 26. SOME RECENT UPDATES • GraphiQl IDE • Included in CraftQL integration. • Allows you to play around with queries and syntax with live results. • Incredibly handy for debugging syntax/formatting issues.
  • 27. SOME RECENT UPDATES • Craft Cloud • PERFECT for Headless. • Especially cost effective for smaller clients and pet projects. • Should be rolling out Q2 2020 to the public, beta by EOY 2019.
  • 28. SOME RECENT UPDATES • Plugin Support for GraphQL • SEOMatic. • Retour. • More to come…
  • 30. WRAP UP AND FREE LINKS • Craft CMS 3.3 bundles GraphQL and adds some configurable options to tailor the authoring experience for Headless application support. • Headless development great for reactive applications where you want and/or need immediate reactions to user actions. • Headless development is beneficial to the client by adding security, performance and data portability to the web application. Clients backend data is decoupled from frontend frameworks and can be made available to new frameworks, or other data consumption destinations. • Craft Cloud coming soon to support cloud-based “serverless” Craft installs.
  • 31. WRAP UP AND FREE LINKS • https://nystudio107.com/blog/using-vuejs-graphql-to-make-practical-magic • https://www.howtographql.com/ • https://craftquest.io/courses/headless-craft/ • https://docs.craftcms.com/v3/dev/headless.html • https://dev.edenspiekermann.com/2019/01/21/turn-craft-into-a-headless-cms/ • https://cognition.happycog.com/article/going-headless-with-craft-cms • https://nystudio107.com/blog/headless-preview-in-craft-cms **
  • 32. THANK YOU CHARLOTTE CRAFT CMS MEETUP “TESTING WITH CRAFT 3 TESTING FRAMEWORK” NEXT MEETUP: WEDNESDAY NOVEMBER 13: (ALSO UPDATING OUR LOGO BY NEXT MEETUP!) SLIDESHARE.NET/JUSTINHOLT20/GOING-HEADLESS-WITH-CRAFT-CMS-33