SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
#DrupalMeetupIslamabad
August 19th 2015
Organized By IKONAMI
www.ikonami.net
Muhammad Asghar Khan
Drupal Consultant - Ikonami
• Drupal Developer
• 7 years experience in IT
• Zend Certified PHP Eng.
• Drupal Module contributor
Speaker
August 19, 2015 www.ikonami.net
Agenda
• What is Drupal 8 in a line?
• Drupal 8 new core modules.
• Modules removed from core.
• Drupal 8 directory Structure.
• Drupal 8 module development.
• Drupal 8 module routing system
• Drupal 8 form API
• Drupal 8 Plugin system
August 19, 2015 www.ikonami.net
What is Drupal 8 in a line?
D8 = D7 + D7 contrib modules
D8 build fairly sophisticated sites without having
to install 30+ contributed modules as we did in
Drupal 7.
August 19, 2015 www.ikonami.net
Drupal 8 - New Core Modules
• Actions
• Ban
• Basic Authentication
• Block Content
• Breakpoint
• CKEditor
• Config
• Config Translation
• Content Translation
• Datetime
• Editor
• Entity Reference
• HAL
• History
• Language
• Link
• Menu Link Content
• Menu UI
• Migrate
• Migrate Drupal
• Options
• Quickedit
• Responsive Image
• Rest
• Serialization
• Telephone
• Text
• Tour
• Views
• Views UI
August 19, 2015 www.ikonami.net
Modules Removed from Core
• Blog
• Dashboard
• Menu
• Open ID
• Overlay
• PHP
• Poll
• Profile
• Translation
• Trigger
August 19, 2015 www.ikonami.net
Drupal 8 - Directory Structure
August 19, 2015 www.ikonami.net
Drupal 8 - Directory Structure
1. /core - Drupal core files like script, misc, themes etc.
2. /libraries - 3rd party libraries, i.e. “wysiwyg editor”
3. /modules – To place contributed and custom modules
4. /profile - contributed and custom profiles
5. /themes - contributed and custom (sub)themes
6. sites/[domain OR default]/{modules, themes} - Site
specific modules and themes can be moved into these
directories to avoid them showing up on every site
7. sites/[domain OR default]/files - Files directory
August 19, 2015 www.ikonami.net
Basic Module Files
 Only “.info.yml” file is required for Drupal 8.
× In Drupal 8, we don’t need “.module file”
August 19, 2015 www.ikonami.net
Drupal 8 - .info.yml file
Drupal 8 introduced new info file for component i.e.
“.info.yml”. So all .info files are moved to .info.yml
files. The new file extension is .info.yml.
This applies to
 Modules
 Themes
 Profiles
August 19, 2015 www.ikonami.net
.info.yml syntax
In .info file we used equal(=) for assigning and square
brackets([]) for array. In .info.yml we will use colon(:) for
assigning and start space and dash for array.
For the most part, change all = to :.
For arrays (e.g. dependencies[] = node), use the following
format in Drupal 8:
dependencies:
- node
In Drupal 7 we use ; for Comments BUT in Drupal 8 we will
use # for Comments.
August 19, 2015 www.ikonami.net
Modified entries in .info.yml File
• New Required Element type
–A new type key is now required with values that indicate the type
of extension. Use module, theme or profile. For example:
–type: module
• Remove files[] entries
–Remove any files[] entries. Classes are now autoloaded.
• Convert configure links to route names
–In Drupal 8, specify the administrative configuration link using the
route name instead of the system path.
• Drupal 7
–configure = admin/config/system/actions
• Drupal 8
–configure: action.admin
August 19, 2015 www.ikonami.net
Drupal 7 - Theme info
August 19, 2015 www.ikonami.net
Drupal 8 - .info.yml
August 19, 2015 www.ikonami.net
Drupal 8 - Module .inf.yml
August 19, 2015 www.ikonami.net
name: My test Module
type: module
description: My first demo module to test my development approach.
package: Web services
version: VERSION
core:8.x
dependencies:
-rest
-serialization
Create your “First module”
Create your info file in your module directory
/modules/hello_d8/hello_d8.yml.
name: Hello D8
description: Demonstrate Drupal 8 module development.
type: module
core: 8.x
August 19, 2015 www.ikonami.net
Create Menu
• In drupal 8 “hook_menu” has been removed and introduced
Routing-Approach.
• Create routing file like [your_module].routing.yml
/modules/hello_d8/hello_d8.routing.yml
hello_d8.page:
path: /hello-d8/page
defaults:
_controller: 'Drupalhello_d8ControllerHelloD8Controller::pageCallback’
_title: 'Hello Drupal 8’
Requirements:
_permission: 'access content'
August 19, 2015 www.ikonami.net
Create your module controller
As Drupal 8 follows PSR-4 folder structure so you need to create your
controller file under
/modules/hello_d8/src/Controller/HelloD8Controller.php
<?php
namespace Drupalhello_d8Controller;
use DrupalCoreControllerControllerBase;
class HelloD8Controller extends ControllerBase {
public function pageCallback () {
return [
'#markup' => $this->t('Welcome Drupal 8 uesers')
];
}
}
August 19, 2015 www.ikonami.net
Drupal 8 Page
August 19, 2015 www.ikonami.net
Create your form in Drupal 8
Add your page path in hello_d8.routing.yml file.
/modules/hello_d8/hello_d8.routing.yml
hello_d8.config:
path: /admin/config/system/hello-d8-config
defaults:
_form: 'Drupalhello_d8FormConfigForm'
_title: 'Drupal 8 Configuration'
requirements:
_permission: 'configure_hello_d8'
August 19, 2015 www.ikonami.net
Create your form in Drupal 8
Create your form class to build your form.
<?php
namespace Drupalhello_d8Form;
use DrupalCoreFormConfigFormBase;
use DrupalCoreFormFormStateInterface;
class ConfigForm extends ConfigFormBase {
protected function getEditableConfigNames() {
return ['hello_d8.settings'];
}
public function getFormId() {
return 'hello_d8_config';
}
function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('hello_d8.settings');
$form['default_count'] = [
'#type' => 'number',
'#title' => $this->t('Default count'),
'#default_value' => $config->get('default_count'),
];
return parent::buildForm($form, $form_state);
}
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$config = $this->config('hello_d8.settings');
$config->set('default_count', $form_state->getValue('default_count'));
$config->save();
}
}
August 19, 2015 www.ikonami.net
Drupal 8 - Form Page
August 19, 2015 www.ikonami.net
Drupal 8 - Plugin API
Plugins are small pieces of functionality that are
swappable. Plugins that perform similar
functionality are of the same plugin type.
August 19, 2015 www.ikonami.net
Drupal 8 - Block Code
Create your plugin class /modules/hello_d8/src/Plugin/Block/HelloD8Block.php
<?php
namespace Drupalhello_d8PluginBlock;
use DrupalCoreBlockBlockBase;
/**
* Create hello_d8 block.
* @Block(
* id = "hello_d8_block",
* admin_label = @Translation("Hello Drupal 8"),
* category = @Translation("System")
* )
*
*/
class HelloD8Block extends BlockBase {
public function build() {
return [
'#markup' => $this->t('Hello Drupal 8 block.')
];
}
}
August 19, 2015 www.ikonami.net
Your Block
August 19, 2015 www.ikonami.net
Thank You
conversation@ikonami.net

Weitere ähnliche Inhalte

Andere mochten auch

ROB PP 2016 RE6
ROB PP 2016 RE6ROB PP 2016 RE6
ROB PP 2016 RE6rob eradus
 
Proje İstatistikleri
Proje İstatistikleriProje İstatistikleri
Proje İstatistikleriSedat Birinci
 
Rio Tinto Capital Markets Day - Sydney
Rio Tinto Capital Markets Day - SydneyRio Tinto Capital Markets Day - Sydney
Rio Tinto Capital Markets Day - SydneyRio Tinto
 
Finding bugs, categorizing bugs and writing good bug reports
Finding bugs, categorizing bugs and writing good bug reportsFinding bugs, categorizing bugs and writing good bug reports
Finding bugs, categorizing bugs and writing good bug reportssachxn1
 
Безопасность детей в интернете. Взгляд родителей.
Безопасность детей в интернете. Взгляд родителей.Безопасность детей в интернете. Взгляд родителей.
Безопасность детей в интернете. Взгляд родителей.FOM-MEDIA
 
Karen vaughn richter resume
Karen vaughn richter resumeKaren vaughn richter resume
Karen vaughn richter resumeKaren Richter
 
Top 8 infant toddler teacher resume samples
Top 8 infant toddler teacher resume samplesTop 8 infant toddler teacher resume samples
Top 8 infant toddler teacher resume sampleskingsmonkey15
 
Top 8 enrichment teacher resume samples
Top 8 enrichment teacher resume samplesTop 8 enrichment teacher resume samples
Top 8 enrichment teacher resume sampleskingsmonkey15
 

Andere mochten auch (10)

ROB PP 2016 RE6
ROB PP 2016 RE6ROB PP 2016 RE6
ROB PP 2016 RE6
 
Proje İstatistikleri
Proje İstatistikleriProje İstatistikleri
Proje İstatistikleri
 
Rio Tinto Capital Markets Day - Sydney
Rio Tinto Capital Markets Day - SydneyRio Tinto Capital Markets Day - Sydney
Rio Tinto Capital Markets Day - Sydney
 
Finding bugs, categorizing bugs and writing good bug reports
Finding bugs, categorizing bugs and writing good bug reportsFinding bugs, categorizing bugs and writing good bug reports
Finding bugs, categorizing bugs and writing good bug reports
 
Как подростки используют социальные сети?: Возможности для образования.
Как подростки используют социальные сети?: Возможности для образования.Как подростки используют социальные сети?: Возможности для образования.
Как подростки используют социальные сети?: Возможности для образования.
 
Безопасность детей в интернете. Взгляд родителей.
Безопасность детей в интернете. Взгляд родителей.Безопасность детей в интернете. Взгляд родителей.
Безопасность детей в интернете. Взгляд родителей.
 
Twitter tweet presentation_2011
Twitter tweet presentation_2011Twitter tweet presentation_2011
Twitter tweet presentation_2011
 
Karen vaughn richter resume
Karen vaughn richter resumeKaren vaughn richter resume
Karen vaughn richter resume
 
Top 8 infant toddler teacher resume samples
Top 8 infant toddler teacher resume samplesTop 8 infant toddler teacher resume samples
Top 8 infant toddler teacher resume samples
 
Top 8 enrichment teacher resume samples
Top 8 enrichment teacher resume samplesTop 8 enrichment teacher resume samples
Top 8 enrichment teacher resume samples
 

Ähnlich wie Drupal 8 overview

Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Acquia
 
Drupal 8 introduction to theming
Drupal 8  introduction to themingDrupal 8  introduction to theming
Drupal 8 introduction to themingBrahampal Singh
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Angela Byron
 
Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015
Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015
Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015Jeffrey McGuire
 
Drupal 8 DX Changes
Drupal 8 DX ChangesDrupal 8 DX Changes
Drupal 8 DX Changesqed42
 
Drupal 8: Most common beginner mistakes
Drupal 8: Most common beginner mistakesDrupal 8: Most common beginner mistakes
Drupal 8: Most common beginner mistakesIztok Smolic
 
The Top 10 Features to Watch Out for in Drupal 8
The Top 10 Features to Watch Out for in Drupal 8The Top 10 Features to Watch Out for in Drupal 8
The Top 10 Features to Watch Out for in Drupal 8SunTecOSS
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentsparkfabrik
 
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...Eric Sembrat
 
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
 
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)Konstantin Komelin
 
Oleksandr Medvediev - Content delivery tools in Drupal 8.
Oleksandr Medvediev - Content delivery tools in Drupal 8.Oleksandr Medvediev - Content delivery tools in Drupal 8.
Oleksandr Medvediev - Content delivery tools in Drupal 8.DrupalCamp Kyiv
 
Future proof your drupal skills - Piyuesh Kumar
Future proof your drupal skills - Piyuesh KumarFuture proof your drupal skills - Piyuesh Kumar
Future proof your drupal skills - Piyuesh KumarDrupal Camp Delhi
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationAmeex Technologies
 
Drupal & Drink Montpellier "Medias in drupal 8"
Drupal & Drink Montpellier "Medias in drupal 8"Drupal & Drink Montpellier "Medias in drupal 8"
Drupal & Drink Montpellier "Medias in drupal 8"Alexandre Todorov
 
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewFrom Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewItalo Mairo
 
Drupal 8 and Pantheon
Drupal 8 and PantheonDrupal 8 and Pantheon
Drupal 8 and PantheonPantheon
 

Ähnlich wie Drupal 8 overview (20)

Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8
 
Drupal 8 introduction to theming
Drupal 8  introduction to themingDrupal 8  introduction to theming
Drupal 8 introduction to theming
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
 
Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015
Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015
Drupal 8 as a Drop-In Content Engine - SymfonyLive Berlin 2015
 
Drupal 8 DX Changes
Drupal 8 DX ChangesDrupal 8 DX Changes
Drupal 8 DX Changes
 
Drupal 8: Most common beginner mistakes
Drupal 8: Most common beginner mistakesDrupal 8: Most common beginner mistakes
Drupal 8: Most common beginner mistakes
 
The Top 10 Features to Watch Out for in Drupal 8
The Top 10 Features to Watch Out for in Drupal 8The Top 10 Features to Watch Out for in Drupal 8
The Top 10 Features to Watch Out for in Drupal 8
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend development
 
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
 
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?
 
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
 
#D8 cx: upgrade your modules to drupal 8
#D8 cx: upgrade your modules to drupal 8 #D8 cx: upgrade your modules to drupal 8
#D8 cx: upgrade your modules to drupal 8
 
Oleksandr Medvediev - Content delivery tools in Drupal 8.
Oleksandr Medvediev - Content delivery tools in Drupal 8.Oleksandr Medvediev - Content delivery tools in Drupal 8.
Oleksandr Medvediev - Content delivery tools in Drupal 8.
 
Future proof your drupal skills - Piyuesh Kumar
Future proof your drupal skills - Piyuesh KumarFuture proof your drupal skills - Piyuesh Kumar
Future proof your drupal skills - Piyuesh Kumar
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 Migration
 
D7 as D8
D7 as D8D7 as D8
D7 as D8
 
Drupal & Drink Montpellier "Medias in drupal 8"
Drupal & Drink Montpellier "Medias in drupal 8"Drupal & Drink Montpellier "Medias in drupal 8"
Drupal & Drink Montpellier "Medias in drupal 8"
 
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewFrom Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
 
Paragraphs at drupal 8.
Paragraphs at drupal 8.Paragraphs at drupal 8.
Paragraphs at drupal 8.
 
Drupal 8 and Pantheon
Drupal 8 and PantheonDrupal 8 and Pantheon
Drupal 8 and Pantheon
 

Kürzlich hochgeladen

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
 
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
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
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
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
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
 
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
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
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
 
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
 
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
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
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
 

Kürzlich hochgeladen (20)

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 ...
 
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
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
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
 
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
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
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
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
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
 
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
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
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
 
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
 
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
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
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
 

Drupal 8 overview

  • 2. Muhammad Asghar Khan Drupal Consultant - Ikonami • Drupal Developer • 7 years experience in IT • Zend Certified PHP Eng. • Drupal Module contributor Speaker August 19, 2015 www.ikonami.net
  • 3. Agenda • What is Drupal 8 in a line? • Drupal 8 new core modules. • Modules removed from core. • Drupal 8 directory Structure. • Drupal 8 module development. • Drupal 8 module routing system • Drupal 8 form API • Drupal 8 Plugin system August 19, 2015 www.ikonami.net
  • 4. What is Drupal 8 in a line? D8 = D7 + D7 contrib modules D8 build fairly sophisticated sites without having to install 30+ contributed modules as we did in Drupal 7. August 19, 2015 www.ikonami.net
  • 5. Drupal 8 - New Core Modules • Actions • Ban • Basic Authentication • Block Content • Breakpoint • CKEditor • Config • Config Translation • Content Translation • Datetime • Editor • Entity Reference • HAL • History • Language • Link • Menu Link Content • Menu UI • Migrate • Migrate Drupal • Options • Quickedit • Responsive Image • Rest • Serialization • Telephone • Text • Tour • Views • Views UI August 19, 2015 www.ikonami.net
  • 6. Modules Removed from Core • Blog • Dashboard • Menu • Open ID • Overlay • PHP • Poll • Profile • Translation • Trigger August 19, 2015 www.ikonami.net
  • 7. Drupal 8 - Directory Structure August 19, 2015 www.ikonami.net
  • 8. Drupal 8 - Directory Structure 1. /core - Drupal core files like script, misc, themes etc. 2. /libraries - 3rd party libraries, i.e. “wysiwyg editor” 3. /modules – To place contributed and custom modules 4. /profile - contributed and custom profiles 5. /themes - contributed and custom (sub)themes 6. sites/[domain OR default]/{modules, themes} - Site specific modules and themes can be moved into these directories to avoid them showing up on every site 7. sites/[domain OR default]/files - Files directory August 19, 2015 www.ikonami.net
  • 9. Basic Module Files  Only “.info.yml” file is required for Drupal 8. × In Drupal 8, we don’t need “.module file” August 19, 2015 www.ikonami.net
  • 10. Drupal 8 - .info.yml file Drupal 8 introduced new info file for component i.e. “.info.yml”. So all .info files are moved to .info.yml files. The new file extension is .info.yml. This applies to  Modules  Themes  Profiles August 19, 2015 www.ikonami.net
  • 11. .info.yml syntax In .info file we used equal(=) for assigning and square brackets([]) for array. In .info.yml we will use colon(:) for assigning and start space and dash for array. For the most part, change all = to :. For arrays (e.g. dependencies[] = node), use the following format in Drupal 8: dependencies: - node In Drupal 7 we use ; for Comments BUT in Drupal 8 we will use # for Comments. August 19, 2015 www.ikonami.net
  • 12. Modified entries in .info.yml File • New Required Element type –A new type key is now required with values that indicate the type of extension. Use module, theme or profile. For example: –type: module • Remove files[] entries –Remove any files[] entries. Classes are now autoloaded. • Convert configure links to route names –In Drupal 8, specify the administrative configuration link using the route name instead of the system path. • Drupal 7 –configure = admin/config/system/actions • Drupal 8 –configure: action.admin August 19, 2015 www.ikonami.net
  • 13. Drupal 7 - Theme info August 19, 2015 www.ikonami.net
  • 14. Drupal 8 - .info.yml August 19, 2015 www.ikonami.net
  • 15. Drupal 8 - Module .inf.yml August 19, 2015 www.ikonami.net name: My test Module type: module description: My first demo module to test my development approach. package: Web services version: VERSION core:8.x dependencies: -rest -serialization
  • 16. Create your “First module” Create your info file in your module directory /modules/hello_d8/hello_d8.yml. name: Hello D8 description: Demonstrate Drupal 8 module development. type: module core: 8.x August 19, 2015 www.ikonami.net
  • 17. Create Menu • In drupal 8 “hook_menu” has been removed and introduced Routing-Approach. • Create routing file like [your_module].routing.yml /modules/hello_d8/hello_d8.routing.yml hello_d8.page: path: /hello-d8/page defaults: _controller: 'Drupalhello_d8ControllerHelloD8Controller::pageCallback’ _title: 'Hello Drupal 8’ Requirements: _permission: 'access content' August 19, 2015 www.ikonami.net
  • 18. Create your module controller As Drupal 8 follows PSR-4 folder structure so you need to create your controller file under /modules/hello_d8/src/Controller/HelloD8Controller.php <?php namespace Drupalhello_d8Controller; use DrupalCoreControllerControllerBase; class HelloD8Controller extends ControllerBase { public function pageCallback () { return [ '#markup' => $this->t('Welcome Drupal 8 uesers') ]; } } August 19, 2015 www.ikonami.net
  • 19. Drupal 8 Page August 19, 2015 www.ikonami.net
  • 20. Create your form in Drupal 8 Add your page path in hello_d8.routing.yml file. /modules/hello_d8/hello_d8.routing.yml hello_d8.config: path: /admin/config/system/hello-d8-config defaults: _form: 'Drupalhello_d8FormConfigForm' _title: 'Drupal 8 Configuration' requirements: _permission: 'configure_hello_d8' August 19, 2015 www.ikonami.net
  • 21. Create your form in Drupal 8 Create your form class to build your form. <?php namespace Drupalhello_d8Form; use DrupalCoreFormConfigFormBase; use DrupalCoreFormFormStateInterface; class ConfigForm extends ConfigFormBase { protected function getEditableConfigNames() { return ['hello_d8.settings']; } public function getFormId() { return 'hello_d8_config'; } function buildForm(array $form, FormStateInterface $form_state) { $config = $this->config('hello_d8.settings'); $form['default_count'] = [ '#type' => 'number', '#title' => $this->t('Default count'), '#default_value' => $config->get('default_count'), ]; return parent::buildForm($form, $form_state); } public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); $config = $this->config('hello_d8.settings'); $config->set('default_count', $form_state->getValue('default_count')); $config->save(); } } August 19, 2015 www.ikonami.net
  • 22. Drupal 8 - Form Page August 19, 2015 www.ikonami.net
  • 23. Drupal 8 - Plugin API Plugins are small pieces of functionality that are swappable. Plugins that perform similar functionality are of the same plugin type. August 19, 2015 www.ikonami.net
  • 24. Drupal 8 - Block Code Create your plugin class /modules/hello_d8/src/Plugin/Block/HelloD8Block.php <?php namespace Drupalhello_d8PluginBlock; use DrupalCoreBlockBlockBase; /** * Create hello_d8 block. * @Block( * id = "hello_d8_block", * admin_label = @Translation("Hello Drupal 8"), * category = @Translation("System") * ) * */ class HelloD8Block extends BlockBase { public function build() { return [ '#markup' => $this->t('Hello Drupal 8 block.') ]; } } August 19, 2015 www.ikonami.net
  • 25. Your Block August 19, 2015 www.ikonami.net