SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Decoupled Drupal
Ahmad Hassan
Skype/drupal.org: drupalmind
Twitter: @drupalmind123
Software Engineer @
Decoupled Drupal
● What is Decoupled/Headless Drupal.
● How it is different from normal drupal architecture.
● Do you really need decoupling?
● How drupal connect to Frontend.
● Drupal 7 Decoupling.
What is Headless/decoupled Drupal?
A decoupled Drupal may allows developers to use frontend Frameworks to render the
front-end experience.
With decoupled Drupal, the Drupal serves as content provider to other front-end
systems such as:
● Native mobile applications
● conversational UIs,
● applications built in JavaScript frameworks.
What is Headless/decoupled Drupal?
● Drupal can behave as back-end applications for native applications, single-page
applications, digital signage, communication device and many others.
● Drupal Services such as the core REST API, JSON API, and GraphQL are actually
Drupal customers.
● Other Applications/Framworks are consuming Drupal as service provider.
● It can be content, configuration or authentication but everything get by request
and response method
What is Headless/decoupled Drupal?
● Instead of sticking to Drupal layout/theme why not try out best user experience
theming frameworks.
● There are some CMSs which provide APIs to create frontend like Contentful etc.
● But Drupal provides API first not API only technique which still enable us to use
drupal default layout and expose drupal content to other Plateforms
Normal Drupal Architecture
Drupal CMS
Theme Layer
Data
Theme layer
Frontend/html
Frontend
(tpl/twigs etc.)
Normal Drupal Architecture
Drupal
Theme Layer
Frontend
(tpl/twigs etc.)
● Drupal generate Contents
● We can define structure according to
design
● Define block, views, context, paragraph,
field collection.
● With all these we can builds drupal
structure
● We can design it with drupal theming tools
Normal Drupal Architecture
● Then comes the theme layer.
● Define your images, presets.
● Template file, tpl or twig files.
● Or define and use theme functions to
redefine some elements.
● Custom modules to override normal behavior
according to design.
Drupal
Theme Layer
Frontend
(tpl/twigs etc.)
Headless Drupal
First step is again same to define
drupal structure according to
design.
But…
Drupal
Web Services
Data
HTML
Json/GraphQL
Front-end Application
Templates
Headless Drupal
But…
Now we will output new data type
instead of HTML produced by
Drupal…
Drupal uses REST API to output
data as jsonDrupal
Web Services
Front-end Application
Templates
Data
HTML
Json/GraphQL
Decouple Drupal Architecture
Drupal
serves as Content
provider
Drupal 8 output is also
possible as json,
hal_json
Theme Layer
JS Framework/
native app or other
interfaces
Front-end - client
GET request
Json
response html
Connect to multiple Frontend
Drupal
Front-end
GET request
APP
Json
response HTMLTheme Layer
JS Framework/
native app or
other interfaces
GET request
Decouple Drupal Architecture
Drupal
Web Services
Data
Frontend/html
Json/GraphQL
Javascript Framework
(React, Angular!!!)
Templates
request
response
Decouple Drupal Architecture
Drupal
Web Services
Data
Frontend/html
Json/GraphQL
Apps
request
response
Decoupling Advantages
Drupal
REST API
Apps
request
response
● Create once,
Publish anywhere,
● Centralized Content
● API First
● Open gate for Frontend developers
● Can Work independently both
frontend and backend developer
Decoupling Advantages
● Migrate/Upgrading Drupal
○ Majore drupal upgrade from 6 to 7 to 6/7 to D8 is relatively expensive.
○ In normal Drupal architecture, we have to upgrade backend and
frontend also need modification as changes in templates.
○ With Decoupling we can reduce frontend effort to minimum.
Decoupling Advantages
● Upgrading/migrate Drupal
○ Above example backend develop in drupal older version. And
frontend in symfony or say angular.
○ When upgrading to drupal, Frontend need no changes, it depends on
responses.
○ Similarly upgrade to React or Node.js dont need to upgrade Drupal 8.
Frontend
Backend
Drupal 7
Symfony
Drupal 8
React
...
...
Decoupling Advantages
● CMS First vs Design first approach
○ CMS first mean you user design can be compromised.
○ And design first means CMS need a lot of custom modifications
○ But with decoupling most of concerns of design can be achieved with
less or no custom modifications.
Decoupling Disadvantage
● Loss Context
○ Front end can’t use inplace editing or edit links directly from landing
pages.
○ Front end can’t use from Drupal admin menus
○ Front end can’t use CMS strong layout diplayes(menus, DS, panels,
Context etc).
Decoupling Disadvantage
● Loss Management
○ Content publishing and unpublishing can be costly.
○ Time control would be tricky to use.
Decoupling Disadvantage
● Preview
○ Live preview is key for editors after creating content.
○ Preview real time content in CMS with decoupled systems is challenging
○ Even more challenging when preview for unpublish content. Editors like to
see their pages before making them public.
○ Preview of some revision is also one of the challenging task to generate.
Advantages vs Disadvantages
● There might be project where you concern about disadvantages and you can work
as decouple, sometimes you need instances preview, to control content
moderation and scheduling.
● And in some project it suits you, if you can have frontend power and invest time.
And specially when you know your CMS content will serve more than one clients.
● So it varies project to project.
Which Drupal version provide more flexibility for
decoupling
● Drupal 7… we can even achieve it with contrib modules
● Drupal 8 provide services as core module, with different output options.
Connecting to Frontend Framework... Web Services
● REST API - Client requests with http request and server(CMS) response as JSON
which support most of JS frameworks.
● GraphQL - it limits the response based on request. So if you need only few fields
you need not to request full object. You can just request few fields and only those
fields will be populated in response.
Connecting to Frontend Framework... Web Services
● Drupal 8 core has RESTful Web Services included.
○ We can expose data as REST resources
○ Customize a REST resource's formats , when requesting http (GET) format
need to specify. exampl.com/node/111?format=json
○ Sending request body containing data , specify request header. (POST,
PATCH)
Connecting to Frontend Framework... Web Services
cURL
curl http://example.com/node/1?_format=hal_json
Guzzle
$response = Drupal::httpClient()
->get('http://example.com/node/1?_format=hal_json', [
'auth' => ['username', 'password'],
]);
$json_string = (string) $response->getBody();
Connecting to Frontend Framework... Web Services
jQuery
jQuery.ajax({
url: 'http://example.com/node/1?_format=hal_json',
method: 'GET',
success: function (comment) {
console.log(comment);
}
});
Drupal 7
Drupal 7
Act as content provider.
Json translation
Theme Layer ---
Custom modules Generate
Json files for contents,
Menus, other configuration
Json Files
Front-end
Drupal 7
Drupal 7
Act as content provider.
Symfony Application
translate the Json
files into HTML
● On content creation or updation
in drupal.
● create /update json file.
● It runs jenkin-jobs to transfer
these files from drupal to
front-end.
● These files are translated to
html in Symfony.
Theme Layer ---
Custom modules Generate
Json files for contents,
Menus, other configuration
Json Files
Front-end
Question/Suggestions/Feedback?

Weitere ähnliche Inhalte

Was ist angesagt?

Drupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsDrupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsphp2ranjan
 
"Paragraphs are more powerful than you can expect" from Vasily Jaremchuk for ...
"Paragraphs are more powerful than you can expect" from Vasily Jaremchuk for ..."Paragraphs are more powerful than you can expect" from Vasily Jaremchuk for ...
"Paragraphs are more powerful than you can expect" from Vasily Jaremchuk for ...DrupalCamp Kyiv
 
Backend accessible
Backend accessibleBackend accessible
Backend accessibleMark Casias
 
Drupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 monthsDrupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 monthsIztok Smolic
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyMarcos Labad
 
Introduction to Drupal Basics
Introduction to Drupal BasicsIntroduction to Drupal Basics
Introduction to Drupal BasicsJuha Niemi
 
Websites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly WebsitesWebsites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly Websiteswebsiteunlimited
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtmlPhúc Đỗ
 
SharePoint 2010 Web Standards & Accessibility
SharePoint 2010 Web Standards & AccessibilitySharePoint 2010 Web Standards & Accessibility
SharePoint 2010 Web Standards & AccessibilityMavention
 
7 Tips For Better JDeveloper Experience
7 Tips For Better JDeveloper Experience7 Tips For Better JDeveloper Experience
7 Tips For Better JDeveloper Experienceshay.shmeltzer
 
Ruby on Rails: Building Web Applications Is Fun Again!
Ruby on Rails: Building Web Applications Is Fun Again!Ruby on Rails: Building Web Applications Is Fun Again!
Ruby on Rails: Building Web Applications Is Fun Again!judofyr
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewlittleMAS
 

Was ist angesagt? (17)

Drupal presentation
Drupal presentationDrupal presentation
Drupal presentation
 
Drupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsDrupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutions
 
OpenCms Days 2013 - Bootstrap your templates
OpenCms Days 2013 - Bootstrap your templatesOpenCms Days 2013 - Bootstrap your templates
OpenCms Days 2013 - Bootstrap your templates
 
"Paragraphs are more powerful than you can expect" from Vasily Jaremchuk for ...
"Paragraphs are more powerful than you can expect" from Vasily Jaremchuk for ..."Paragraphs are more powerful than you can expect" from Vasily Jaremchuk for ...
"Paragraphs are more powerful than you can expect" from Vasily Jaremchuk for ...
 
Backend accessible
Backend accessibleBackend accessible
Backend accessible
 
Drupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 monthsDrupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 months
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
 
Introduction to Drupal Basics
Introduction to Drupal BasicsIntroduction to Drupal Basics
Introduction to Drupal Basics
 
Websites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly WebsitesWebsites Unlimited - Pay Monthly Websites
Websites Unlimited - Pay Monthly Websites
 
Dhtml sohaib ch
Dhtml sohaib chDhtml sohaib ch
Dhtml sohaib ch
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtml
 
HTML 5 Overview
HTML 5 OverviewHTML 5 Overview
HTML 5 Overview
 
SharePoint 2010 Web Standards & Accessibility
SharePoint 2010 Web Standards & AccessibilitySharePoint 2010 Web Standards & Accessibility
SharePoint 2010 Web Standards & Accessibility
 
7 Tips For Better JDeveloper Experience
7 Tips For Better JDeveloper Experience7 Tips For Better JDeveloper Experience
7 Tips For Better JDeveloper Experience
 
Ruby on Rails: Building Web Applications Is Fun Again!
Ruby on Rails: Building Web Applications Is Fun Again!Ruby on Rails: Building Web Applications Is Fun Again!
Ruby on Rails: Building Web Applications Is Fun Again!
 
HTML5
HTML5HTML5
HTML5
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 Review
 

Ähnlich wie Decoupled drupal DcRuhr

How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?DrupalGeeks
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationAmeex Technologies
 
Decoupled Drupal: What This Means for Developers
Decoupled Drupal: What This Means for DevelopersDecoupled Drupal: What This Means for Developers
Decoupled Drupal: What This Means for DevelopersAcquia
 
Applied progressive decoupling weather.com, angular, and drupal
Applied progressive decoupling  weather.com, angular, and drupalApplied progressive decoupling  weather.com, angular, and drupal
Applied progressive decoupling weather.com, angular, and drupalAcquia
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?nuppla
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Angela Byron
 
Why I've Not bothered With Drupal 8
Why I've Not bothered With Drupal 8Why I've Not bothered With Drupal 8
Why I've Not bothered With Drupal 8Robert Carr
 
What in store in drupal 8
What in store in drupal 8 What in store in drupal 8
What in store in drupal 8 Shyamala Rajaram
 
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?Wong Hoi Sing Edison
 
Drupal
DrupalDrupal
Drupalbtopro
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Phase2
 
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1Vladimir Roudakov
 
Headless drupal with JS Framework
Headless drupal with JS FrameworkHeadless drupal with JS Framework
Headless drupal with JS FrameworkPanshul Khurana
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Anne Tomasevich
 

Ähnlich wie Decoupled drupal DcRuhr (20)

Decoupled drupal
Decoupled drupal Decoupled drupal
Decoupled drupal
 
How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 Migration
 
Decoupled Drupal: What This Means for Developers
Decoupled Drupal: What This Means for DevelopersDecoupled Drupal: What This Means for Developers
Decoupled Drupal: What This Means for Developers
 
Applied progressive decoupling weather.com, angular, and drupal
Applied progressive decoupling  weather.com, angular, and drupalApplied progressive decoupling  weather.com, angular, and drupal
Applied progressive decoupling weather.com, angular, and drupal
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
 
Web components
Web componentsWeb components
Web components
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
 
Why I've Not bothered With Drupal 8
Why I've Not bothered With Drupal 8Why I've Not bothered With Drupal 8
Why I've Not bothered With Drupal 8
 
What in store in drupal 8
What in store in drupal 8 What in store in drupal 8
What in store in drupal 8
 
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
 
Drupal
DrupalDrupal
Drupal
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7
 
Next.js with drupal, the good parts
Next.js with drupal, the good partsNext.js with drupal, the good parts
Next.js with drupal, the good parts
 
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
Drupal south 2014 - bootstrap vs foundation deathmatch - v.1.1
 
Headless drupal with JS Framework
Headless drupal with JS FrameworkHeadless drupal with JS Framework
Headless drupal with JS Framework
 
Drupal
DrupalDrupal
Drupal
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8
 
Drupal
DrupalDrupal
Drupal
 
The Decoupled CMS in Financial Services
The Decoupled CMS in Financial ServicesThe Decoupled CMS in Financial Services
The Decoupled CMS in Financial Services
 

Kürzlich hochgeladen

Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
(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
 
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
 
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
 
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
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
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
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
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
 

Kürzlich hochgeladen (20)

Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
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...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
(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...
 
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
 
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
 
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
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
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
 
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
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
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
 

Decoupled drupal DcRuhr

  • 1. Decoupled Drupal Ahmad Hassan Skype/drupal.org: drupalmind Twitter: @drupalmind123 Software Engineer @
  • 2. Decoupled Drupal ● What is Decoupled/Headless Drupal. ● How it is different from normal drupal architecture. ● Do you really need decoupling? ● How drupal connect to Frontend. ● Drupal 7 Decoupling.
  • 3. What is Headless/decoupled Drupal? A decoupled Drupal may allows developers to use frontend Frameworks to render the front-end experience. With decoupled Drupal, the Drupal serves as content provider to other front-end systems such as: ● Native mobile applications ● conversational UIs, ● applications built in JavaScript frameworks.
  • 4. What is Headless/decoupled Drupal? ● Drupal can behave as back-end applications for native applications, single-page applications, digital signage, communication device and many others. ● Drupal Services such as the core REST API, JSON API, and GraphQL are actually Drupal customers. ● Other Applications/Framworks are consuming Drupal as service provider. ● It can be content, configuration or authentication but everything get by request and response method
  • 5. What is Headless/decoupled Drupal? ● Instead of sticking to Drupal layout/theme why not try out best user experience theming frameworks. ● There are some CMSs which provide APIs to create frontend like Contentful etc. ● But Drupal provides API first not API only technique which still enable us to use drupal default layout and expose drupal content to other Plateforms
  • 6. Normal Drupal Architecture Drupal CMS Theme Layer Data Theme layer Frontend/html Frontend (tpl/twigs etc.)
  • 7. Normal Drupal Architecture Drupal Theme Layer Frontend (tpl/twigs etc.) ● Drupal generate Contents ● We can define structure according to design ● Define block, views, context, paragraph, field collection. ● With all these we can builds drupal structure ● We can design it with drupal theming tools
  • 8. Normal Drupal Architecture ● Then comes the theme layer. ● Define your images, presets. ● Template file, tpl or twig files. ● Or define and use theme functions to redefine some elements. ● Custom modules to override normal behavior according to design. Drupal Theme Layer Frontend (tpl/twigs etc.)
  • 9. Headless Drupal First step is again same to define drupal structure according to design. But… Drupal Web Services Data HTML Json/GraphQL Front-end Application Templates
  • 10. Headless Drupal But… Now we will output new data type instead of HTML produced by Drupal… Drupal uses REST API to output data as jsonDrupal Web Services Front-end Application Templates Data HTML Json/GraphQL
  • 11. Decouple Drupal Architecture Drupal serves as Content provider Drupal 8 output is also possible as json, hal_json Theme Layer JS Framework/ native app or other interfaces Front-end - client GET request Json response html
  • 12. Connect to multiple Frontend Drupal Front-end GET request APP Json response HTMLTheme Layer JS Framework/ native app or other interfaces GET request
  • 13. Decouple Drupal Architecture Drupal Web Services Data Frontend/html Json/GraphQL Javascript Framework (React, Angular!!!) Templates request response
  • 14. Decouple Drupal Architecture Drupal Web Services Data Frontend/html Json/GraphQL Apps request response
  • 15. Decoupling Advantages Drupal REST API Apps request response ● Create once, Publish anywhere, ● Centralized Content ● API First ● Open gate for Frontend developers ● Can Work independently both frontend and backend developer
  • 16. Decoupling Advantages ● Migrate/Upgrading Drupal ○ Majore drupal upgrade from 6 to 7 to 6/7 to D8 is relatively expensive. ○ In normal Drupal architecture, we have to upgrade backend and frontend also need modification as changes in templates. ○ With Decoupling we can reduce frontend effort to minimum.
  • 17. Decoupling Advantages ● Upgrading/migrate Drupal ○ Above example backend develop in drupal older version. And frontend in symfony or say angular. ○ When upgrading to drupal, Frontend need no changes, it depends on responses. ○ Similarly upgrade to React or Node.js dont need to upgrade Drupal 8. Frontend Backend Drupal 7 Symfony Drupal 8 React ... ...
  • 18. Decoupling Advantages ● CMS First vs Design first approach ○ CMS first mean you user design can be compromised. ○ And design first means CMS need a lot of custom modifications ○ But with decoupling most of concerns of design can be achieved with less or no custom modifications.
  • 19. Decoupling Disadvantage ● Loss Context ○ Front end can’t use inplace editing or edit links directly from landing pages. ○ Front end can’t use from Drupal admin menus ○ Front end can’t use CMS strong layout diplayes(menus, DS, panels, Context etc).
  • 20. Decoupling Disadvantage ● Loss Management ○ Content publishing and unpublishing can be costly. ○ Time control would be tricky to use.
  • 21. Decoupling Disadvantage ● Preview ○ Live preview is key for editors after creating content. ○ Preview real time content in CMS with decoupled systems is challenging ○ Even more challenging when preview for unpublish content. Editors like to see their pages before making them public. ○ Preview of some revision is also one of the challenging task to generate.
  • 22. Advantages vs Disadvantages ● There might be project where you concern about disadvantages and you can work as decouple, sometimes you need instances preview, to control content moderation and scheduling. ● And in some project it suits you, if you can have frontend power and invest time. And specially when you know your CMS content will serve more than one clients. ● So it varies project to project.
  • 23. Which Drupal version provide more flexibility for decoupling ● Drupal 7… we can even achieve it with contrib modules ● Drupal 8 provide services as core module, with different output options.
  • 24. Connecting to Frontend Framework... Web Services ● REST API - Client requests with http request and server(CMS) response as JSON which support most of JS frameworks. ● GraphQL - it limits the response based on request. So if you need only few fields you need not to request full object. You can just request few fields and only those fields will be populated in response.
  • 25. Connecting to Frontend Framework... Web Services ● Drupal 8 core has RESTful Web Services included. ○ We can expose data as REST resources ○ Customize a REST resource's formats , when requesting http (GET) format need to specify. exampl.com/node/111?format=json ○ Sending request body containing data , specify request header. (POST, PATCH)
  • 26. Connecting to Frontend Framework... Web Services cURL curl http://example.com/node/1?_format=hal_json Guzzle $response = Drupal::httpClient() ->get('http://example.com/node/1?_format=hal_json', [ 'auth' => ['username', 'password'], ]); $json_string = (string) $response->getBody();
  • 27. Connecting to Frontend Framework... Web Services jQuery jQuery.ajax({ url: 'http://example.com/node/1?_format=hal_json', method: 'GET', success: function (comment) { console.log(comment); } });
  • 28. Drupal 7 Drupal 7 Act as content provider. Json translation Theme Layer --- Custom modules Generate Json files for contents, Menus, other configuration Json Files Front-end
  • 29. Drupal 7 Drupal 7 Act as content provider. Symfony Application translate the Json files into HTML ● On content creation or updation in drupal. ● create /update json file. ● It runs jenkin-jobs to transfer these files from drupal to front-end. ● These files are translated to html in Symfony. Theme Layer --- Custom modules Generate Json files for contents, Menus, other configuration Json Files Front-end