SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
BEGINNING MODULE DEVELOPMENT
Joe Crespo | Developer, Aten Design Group
Monday, July 1, 13
INTRODUCTIONS ARE IN ORDER
Desktop publishing >> Graphic design >> Web design >> PHP developer >> Drupal
Joe Crespo | Developer, Aten Design Group
Monday, July 1, 13
PART 1
“HELLO WORLD!”
Monday, July 1, 13
Drupal has its own set of vocabulary.
1. “Nodes,”“entities,” and “modules” have
specific meanings in Drupal that may
differ from what you think of as a
“node,” “entity,” or “module.”
Getting a handle on these concepts will
elevate your Drupal development skills.
ESSENTIALVOCABULARY
Terms to Know:
1. blocks
2. content types
3. entities
4. fields
5. hooks
6. nodes
7. taxonomy
8. themes
Beginning Module Development | Getting Started
Monday, July 1, 13
hook_form_alter()
Use your module to change an existing form.
drupal_add_css()
Add your own CSS file to add styles or amend
existing.
drupal_get_path()
Returns a path within the Drupal site structure.
DRUPAL FUNCTIONS
Beginning Module Development |The Context Module
Monday, July 1, 13
1. Adding new functionality to
Drupal means installing and
activating existing modules, or
creating new ones.
DRUPAL IS MODULAR
Beginning Module Development | Getting Started
Monday, July 1, 13
2. Modules communicate with one
another and manipulate data
through a series of hooks.
HOOKS
Beginning Module Development | Getting Started
Monday, July 1, 13
Hooks are functions automatically called
during execution.
Your module can make changes to content or
functionality by invoking these hooks.
HOOKS 2: ELECTRIC BOOGALOO
Beginning Module Development | Getting Started
For example:
Your Module Name: my_first_module
Drupal Hook:  hook_form_alter()
Module invokes Hook with my_first_module_form_alter()
Monday, July 1, 13
1. Drupal 7 is not object-oriented. While
Drupal does use objects, as its core,
Drupal is procedural. 
DRUPAL IS NOT DOWN WITH O.O.P.
Beginning Module Development | Getting Started
Monday, July 1, 13
2. Drupal loves enormous multidimensional arrays.
YOU DOWN WITH OOP?
Beginning Module Development | Getting Started
Monday, July 1, 13
PART 2
RULES OFTHUMB
Monday, July 1, 13
DRUPAL DEVELOPMENT PRINCIPLES
“Every time you hack core, God kills a kitten”
Beginning Module Development | Rules ofThumb
Monday, July 1, 13
DRUPAL DEVELOPMENT FUNDAMENTALS
1. Never add functionality to your
site by making changes to Drupal
core.
2. Avoid hacking contrib modules.
Beginning Module Development | Rules ofThumb
Monday, July 1, 13
Separate Drupal core modules, contrib modules, and your custom modules.
root directory
|__ modules <<< this is where core modules live – DO NOTTOUCH!
|__ sites
|__ all
    |__ modules
        |__ contrib <<< this is where the modules you download live
          |__ custom <<< this is where the modules you build live
ORGANIZINGYOUR SITE
Beginning Module Development | Rules ofThumb
Monday, July 1, 13
• Always keep in mind that the
module you are contemplating might
already exist.
• Search Drupal.org to see if the
module has already been built.
• If you don’t find an obvious answer,
ask on IRC.
BEFOREYOU START DEVELOPING A MODULE
Beginning Module Development | Rules ofThumb
Monday, July 1, 13
Clear the cache.
THE BEST DRUPALTIPYOU’LL EVER HEAR
Beginning Module Development | Rules ofThumb
That is all.
Monday, July 1, 13
PART 3
PUTTINGTHIS SESSION IN “CONTEXT”
Monday, July 1, 13
What Context does that’s pertinent to this session it that it allows site
builders to add blocks of content to regions of the page if certain
criteria are met.
For example:
You want to advertise free shipping, but only want to show that
message on your catalog index page at http://example.com/catalog.
You would create a block advertising free shipping and then set the
context to only show that block when the path is currently “catalog”
THE CONTEXT MODULE
Beginning Module Development |The Context Module
Monday, July 1, 13
DEMO
Monday, July 1, 13
CONCLUSION
WHAT HAVE WE LEARNED?
Monday, July 1, 13
What else can we do with
context_ui_extras?
This module solves one problem
with the UI, but maybe there are
ways to improve it?
1. More efficient:
hook_ form_ FORM_ID_alter()
2. Add a time condition to Context.
3. Make the Reactions draggable.
JUSTTHETIP OFTHE ICEBERG
Beginning Module Development | Now what?
Monday, July 1, 13
DRUPALTOOLBOX
Get to know these things: (if you don’t already)
1. Git: The version control software of choice for Drupal.
2. drush: A command line tool used for Drupal development.
3. devel: A really useful Drupal development module.
4. IRC: Internet Relay Chat and a helpful support tool used
throughout the community.
5. api.drupal.org is your new best friend.
Beginning Module Development |Toolbox
Monday, July 1, 13
BEGINNING MODULE DEVELOPMENT
Joe Crespo | Developer, Aten Design Group
Monday, July 1, 13

Contenu connexe

En vedette

Herd the CATS! Project management drupalcamp colorado 2013
Herd the CATS! Project management drupalcamp colorado 2013Herd the CATS! Project management drupalcamp colorado 2013
Herd the CATS! Project management drupalcamp colorado 2013Creech
 
Drupal 7 Development: Beginning Module Development
Drupal 7 Development: Beginning Module DevelopmentDrupal 7 Development: Beginning Module Development
Drupal 7 Development: Beginning Module DevelopmentJoe Crespo
 
Old Dogs, New Tricks: Life After Launch
Old Dogs, New Tricks: Life After LaunchOld Dogs, New Tricks: Life After Launch
Old Dogs, New Tricks: Life After LaunchJoe Crespo
 
Case study for agile software development:
Case study for agile software development: Case study for agile software development:
Case study for agile software development: Joe Crespo
 
Core+Paths: A Design Framework for Findability, Prioritization and Value
Core+Paths: A Design Framework for Findability, Prioritization and ValueCore+Paths: A Design Framework for Findability, Prioritization and Value
Core+Paths: A Design Framework for Findability, Prioritization and ValueAre Halland
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

En vedette (7)

Herd the CATS! Project management drupalcamp colorado 2013
Herd the CATS! Project management drupalcamp colorado 2013Herd the CATS! Project management drupalcamp colorado 2013
Herd the CATS! Project management drupalcamp colorado 2013
 
Drupal 7 Development: Beginning Module Development
Drupal 7 Development: Beginning Module DevelopmentDrupal 7 Development: Beginning Module Development
Drupal 7 Development: Beginning Module Development
 
Old Dogs, New Tricks: Life After Launch
Old Dogs, New Tricks: Life After LaunchOld Dogs, New Tricks: Life After Launch
Old Dogs, New Tricks: Life After Launch
 
Case study for agile software development:
Case study for agile software development: Case study for agile software development:
Case study for agile software development:
 
Core+Paths: A Design Framework for Findability, Prioritization and Value
Core+Paths: A Design Framework for Findability, Prioritization and ValueCore+Paths: A Design Framework for Findability, Prioritization and Value
Core+Paths: A Design Framework for Findability, Prioritization and Value
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Similaire à Session v1

Top 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal projectTop 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal projectIztok Smolic
 
Top 11 most popular drupal 8 ready modules of 2017
Top 11 most popular drupal 8 ready modules of 2017Top 11 most popular drupal 8 ready modules of 2017
Top 11 most popular drupal 8 ready modules of 2017MAAN Softwares INC.
 
Top 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies makeTop 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies makeIztok Smolic
 
Drupal theming 101
Drupal theming 101Drupal theming 101
Drupal theming 101Exove
 
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
 
Hello Drupal!
Hello Drupal!Hello Drupal!
Hello Drupal!Acquia
 
Introduction into Drupal site building
Introduction into Drupal site buildingIntroduction into Drupal site building
Introduction into Drupal site buildingIztok Smolic
 
Drupalcamp Tallinn - Drupal 8
Drupalcamp Tallinn - Drupal 8Drupalcamp Tallinn - Drupal 8
Drupalcamp Tallinn - Drupal 8drupalcampest
 
Contributing to Drupal
Contributing to DrupalContributing to Drupal
Contributing to DrupalChris Skene
 
Drupal module development
Drupal module developmentDrupal module development
Drupal module developmentRachit Gupta
 
Architecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampArchitecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampDipen Chaudhary
 
Drupal Multi-Site Setup
Drupal Multi-Site SetupDrupal Multi-Site Setup
Drupal Multi-Site Setupylynfatt
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationDevelopment Seed
 
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)Acquia
 
Fronteers - Drupal 7 ux
Fronteers   - Drupal 7 uxFronteers   - Drupal 7 ux
Fronteers - Drupal 7 uxBojhan
 
Style guides in drupal development workflows
Style guides in drupal development workflowsStyle guides in drupal development workflows
Style guides in drupal development workflowsKalin Chernev
 

Similaire à Session v1 (20)

Top 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal projectTop 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal project
 
Top 11 most popular drupal 8 ready modules of 2017
Top 11 most popular drupal 8 ready modules of 2017Top 11 most popular drupal 8 ready modules of 2017
Top 11 most popular drupal 8 ready modules of 2017
 
Top 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies makeTop 20 Drupal Mistakes newbies make
Top 20 Drupal Mistakes newbies make
 
Drupal theming 101
Drupal theming 101Drupal theming 101
Drupal theming 101
 
Using Features
Using FeaturesUsing Features
Using Features
 
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...
 
Hello Drupal!
Hello Drupal!Hello Drupal!
Hello Drupal!
 
Introduction into Drupal site building
Introduction into Drupal site buildingIntroduction into Drupal site building
Introduction into Drupal site building
 
Drupalcamp Tallinn - Drupal 8
Drupalcamp Tallinn - Drupal 8Drupalcamp Tallinn - Drupal 8
Drupalcamp Tallinn - Drupal 8
 
Contributing to Drupal
Contributing to DrupalContributing to Drupal
Contributing to Drupal
 
Drupal module development
Drupal module developmentDrupal module development
Drupal module development
 
Architecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampArchitecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal Camp
 
Drupal Multi-Site Setup
Drupal Multi-Site SetupDrupal Multi-Site Setup
Drupal Multi-Site Setup
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
 
Drupal 8 Modules
Drupal 8 ModulesDrupal 8 Modules
Drupal 8 Modules
 
Drupal
DrupalDrupal
Drupal
 
Drupal Introduction
Drupal IntroductionDrupal Introduction
Drupal Introduction
 
Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)Become a Better Developer with Debugging Techniques for Drupal (and more!)
Become a Better Developer with Debugging Techniques for Drupal (and more!)
 
Fronteers - Drupal 7 ux
Fronteers   - Drupal 7 uxFronteers   - Drupal 7 ux
Fronteers - Drupal 7 ux
 
Style guides in drupal development workflows
Style guides in drupal development workflowsStyle guides in drupal development workflows
Style guides in drupal development workflows
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Dernier (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Session v1

  • 1. BEGINNING MODULE DEVELOPMENT Joe Crespo | Developer, Aten Design Group Monday, July 1, 13
  • 2. INTRODUCTIONS ARE IN ORDER Desktop publishing >> Graphic design >> Web design >> PHP developer >> Drupal Joe Crespo | Developer, Aten Design Group Monday, July 1, 13
  • 4. Drupal has its own set of vocabulary. 1. “Nodes,”“entities,” and “modules” have specific meanings in Drupal that may differ from what you think of as a “node,” “entity,” or “module.” Getting a handle on these concepts will elevate your Drupal development skills. ESSENTIALVOCABULARY Terms to Know: 1. blocks 2. content types 3. entities 4. fields 5. hooks 6. nodes 7. taxonomy 8. themes Beginning Module Development | Getting Started Monday, July 1, 13
  • 5. hook_form_alter() Use your module to change an existing form. drupal_add_css() Add your own CSS file to add styles or amend existing. drupal_get_path() Returns a path within the Drupal site structure. DRUPAL FUNCTIONS Beginning Module Development |The Context Module Monday, July 1, 13
  • 6. 1. Adding new functionality to Drupal means installing and activating existing modules, or creating new ones. DRUPAL IS MODULAR Beginning Module Development | Getting Started Monday, July 1, 13
  • 7. 2. Modules communicate with one another and manipulate data through a series of hooks. HOOKS Beginning Module Development | Getting Started Monday, July 1, 13
  • 8. Hooks are functions automatically called during execution. Your module can make changes to content or functionality by invoking these hooks. HOOKS 2: ELECTRIC BOOGALOO Beginning Module Development | Getting Started For example: Your Module Name: my_first_module Drupal Hook:  hook_form_alter() Module invokes Hook with my_first_module_form_alter() Monday, July 1, 13
  • 9. 1. Drupal 7 is not object-oriented. While Drupal does use objects, as its core, Drupal is procedural.  DRUPAL IS NOT DOWN WITH O.O.P. Beginning Module Development | Getting Started Monday, July 1, 13
  • 10. 2. Drupal loves enormous multidimensional arrays. YOU DOWN WITH OOP? Beginning Module Development | Getting Started Monday, July 1, 13
  • 12. DRUPAL DEVELOPMENT PRINCIPLES “Every time you hack core, God kills a kitten” Beginning Module Development | Rules ofThumb Monday, July 1, 13
  • 13. DRUPAL DEVELOPMENT FUNDAMENTALS 1. Never add functionality to your site by making changes to Drupal core. 2. Avoid hacking contrib modules. Beginning Module Development | Rules ofThumb Monday, July 1, 13
  • 14. Separate Drupal core modules, contrib modules, and your custom modules. root directory |__ modules <<< this is where core modules live – DO NOTTOUCH! |__ sites |__ all     |__ modules         |__ contrib <<< this is where the modules you download live           |__ custom <<< this is where the modules you build live ORGANIZINGYOUR SITE Beginning Module Development | Rules ofThumb Monday, July 1, 13
  • 15. • Always keep in mind that the module you are contemplating might already exist. • Search Drupal.org to see if the module has already been built. • If you don’t find an obvious answer, ask on IRC. BEFOREYOU START DEVELOPING A MODULE Beginning Module Development | Rules ofThumb Monday, July 1, 13
  • 16. Clear the cache. THE BEST DRUPALTIPYOU’LL EVER HEAR Beginning Module Development | Rules ofThumb That is all. Monday, July 1, 13
  • 17. PART 3 PUTTINGTHIS SESSION IN “CONTEXT” Monday, July 1, 13
  • 18. What Context does that’s pertinent to this session it that it allows site builders to add blocks of content to regions of the page if certain criteria are met. For example: You want to advertise free shipping, but only want to show that message on your catalog index page at http://example.com/catalog. You would create a block advertising free shipping and then set the context to only show that block when the path is currently “catalog” THE CONTEXT MODULE Beginning Module Development |The Context Module Monday, July 1, 13
  • 20. CONCLUSION WHAT HAVE WE LEARNED? Monday, July 1, 13
  • 21. What else can we do with context_ui_extras? This module solves one problem with the UI, but maybe there are ways to improve it? 1. More efficient: hook_ form_ FORM_ID_alter() 2. Add a time condition to Context. 3. Make the Reactions draggable. JUSTTHETIP OFTHE ICEBERG Beginning Module Development | Now what? Monday, July 1, 13
  • 22. DRUPALTOOLBOX Get to know these things: (if you don’t already) 1. Git: The version control software of choice for Drupal. 2. drush: A command line tool used for Drupal development. 3. devel: A really useful Drupal development module. 4. IRC: Internet Relay Chat and a helpful support tool used throughout the community. 5. api.drupal.org is your new best friend. Beginning Module Development |Toolbox Monday, July 1, 13
  • 23. BEGINNING MODULE DEVELOPMENT Joe Crespo | Developer, Aten Design Group Monday, July 1, 13