This session outlines and explains Drupal 8 AJAX callback commands and how to use them. AJAX callback commands are the sets of PHP and JavaScript functions that control all AJAX functionality on a Drupal site. You will be surprised about how simple and straight forward they are. Mastering these commands will allow your AJAX calls to do so much more then just return rendered HTML.
This session is presented in three parts.
- First, explaining what AJAX callback commands are.
- Second, explaining how to use AJAX callback commands.
- Third, explaining how to create and use your own custom commands.
Each section provides example code and a real world Drupal 8 scenario.
Demystifying Drupal AJAX Callback CommandsMichael Miles
When Drupal 7 was released in 2011, it came with an improved implementation of AJAX functionality. Good-bye “AHAH” and hello “AJAX Framework”. But four years later, some of the improvements that came along with the Drupal AJAX Framework go widely unused or unknown.
Introducing AJAX commands. The set of functions you should already be using, which allow AJAX callbacks to do much more then return rendered HTML.
This session will highlight and outline the Drupal AJAX command functions offered by the AJAX framework in both Drupal 7 and Drupal 8. In this session we will cover the following:
- The Drupal AJAX command functions.
- What functionality AJAX command functions provide.
- When and how to use the AJAX command functions.
- How to create custom AJAX commands.
Demystifying AJAX Callback Commands in Drupal 8Michael Miles
This session outlines and explains Drupal 8 AJAX callback commands and how to use them. AJAX callback commands are the sets of PHP and JavaScript functions that control all AJAX functionality on a Drupal site. You will be suprised about how simple and straight forward they are. Mastering these commands will allow your AJAX calls to do so much more then just return rendered HTML. Allowing you to provide the visitors of your Drupal 8 site a more dynamic, richers experience.
This session is presented in three parts.
First, explaining what AJAX callback commands are.
Second, explaining how to use AJAX callback commands.
Third, explaining how to create and use your own custom commands.
Each section provides example code and walks through a real world Drupal 8 scenario.
Attendees should already be familiar with PHP and JavaScript, as well as, have a general understanding of Drupal and AJAX.
Drupal8Day: Demystifying Drupal 8 Ajax Callback commandsMichael Miles
This session outlines and explains Drupal 8 AJAX callback commands and how to use them. AJAX callback commands are the sets of PHP and JavaScript functions that control all AJAX functionality on a Drupal site. You will be surprised about how simple and straight forward they are. Mastering these commands will allow your AJAX calls to do so much more then just return rendered HTML. Allowing you to provide the visitors of your Drupal 8 site a more dynamic, richer experience.
NYCCAMP 2015 Demystifying Drupal AJAX Callback CommandsMichael Miles
When Drupal 7 was released in 2011, it came with an improved implementation of AJAX functionality. Good-bye “AHAH” and hello “AJAX Framework”. But four years later, some of the improvements that came along with the Drupal AJAX Framework go widely unused or unknown.
Introducing AJAX Callback commands. The set of functions you should already be using, which allow AJAX callbacks to do much more then return rendered HTML.
This session will highlight and outline the Drupal AJAX Callback command functions offered by the AJAX framework in both Drupal 7 and Drupal 8. In this session we will cover the following:
The Drupal AJAX command functions.
What functionality AJAX command functions provide.
When and how to use the AJAX command functions.
How to create custom AJAX commands.
탑크리에듀교육센터(www.topcredu.co.kr)제공
스프링프레임워크 & 마이바티스(Spring Framework, MyBatis)
18번째 자료입니다. 참고하시어 많은 도움되셨길 바랍니다.
교육 및 수강문의/기타문의사항은 홈페이지(www.topcredu.co.kr)를 통하여 하실 수 있습니다.^^
Demystifying Drupal AJAX Callback CommandsMichael Miles
When Drupal 7 was released in 2011, it came with an improved implementation of AJAX functionality. Good-bye “AHAH” and hello “AJAX Framework”. But four years later, some of the improvements that came along with the Drupal AJAX Framework go widely unused or unknown.
Introducing AJAX commands. The set of functions you should already be using, which allow AJAX callbacks to do much more then return rendered HTML.
This session will highlight and outline the Drupal AJAX command functions offered by the AJAX framework in both Drupal 7 and Drupal 8. In this session we will cover the following:
- The Drupal AJAX command functions.
- What functionality AJAX command functions provide.
- When and how to use the AJAX command functions.
- How to create custom AJAX commands.
Demystifying AJAX Callback Commands in Drupal 8Michael Miles
This session outlines and explains Drupal 8 AJAX callback commands and how to use them. AJAX callback commands are the sets of PHP and JavaScript functions that control all AJAX functionality on a Drupal site. You will be suprised about how simple and straight forward they are. Mastering these commands will allow your AJAX calls to do so much more then just return rendered HTML. Allowing you to provide the visitors of your Drupal 8 site a more dynamic, richers experience.
This session is presented in three parts.
First, explaining what AJAX callback commands are.
Second, explaining how to use AJAX callback commands.
Third, explaining how to create and use your own custom commands.
Each section provides example code and walks through a real world Drupal 8 scenario.
Attendees should already be familiar with PHP and JavaScript, as well as, have a general understanding of Drupal and AJAX.
Drupal8Day: Demystifying Drupal 8 Ajax Callback commandsMichael Miles
This session outlines and explains Drupal 8 AJAX callback commands and how to use them. AJAX callback commands are the sets of PHP and JavaScript functions that control all AJAX functionality on a Drupal site. You will be surprised about how simple and straight forward they are. Mastering these commands will allow your AJAX calls to do so much more then just return rendered HTML. Allowing you to provide the visitors of your Drupal 8 site a more dynamic, richer experience.
NYCCAMP 2015 Demystifying Drupal AJAX Callback CommandsMichael Miles
When Drupal 7 was released in 2011, it came with an improved implementation of AJAX functionality. Good-bye “AHAH” and hello “AJAX Framework”. But four years later, some of the improvements that came along with the Drupal AJAX Framework go widely unused or unknown.
Introducing AJAX Callback commands. The set of functions you should already be using, which allow AJAX callbacks to do much more then return rendered HTML.
This session will highlight and outline the Drupal AJAX Callback command functions offered by the AJAX framework in both Drupal 7 and Drupal 8. In this session we will cover the following:
The Drupal AJAX command functions.
What functionality AJAX command functions provide.
When and how to use the AJAX command functions.
How to create custom AJAX commands.
탑크리에듀교육센터(www.topcredu.co.kr)제공
스프링프레임워크 & 마이바티스(Spring Framework, MyBatis)
18번째 자료입니다. 참고하시어 많은 도움되셨길 바랍니다.
교육 및 수강문의/기타문의사항은 홈페이지(www.topcredu.co.kr)를 통하여 하실 수 있습니다.^^
Sylius and Api Platform The story of integrationŁukasz Chruściel
Being a part of the Symfony ecosystem gives access to the vast number of open-source solutions built on top. A lot of people voluntarily committed the time to make impressive, multipurpose solutions. One of these solutions is the API Platform, the most mature framework for API development.
In Sylius, it was always our goal to take advantage of the best of the breed and integrate with others. Keeping this in mind, we have decided to combine both projects and deliver a new quality in the headless e-commerce world.
How did it go to integrate new infrastructure to the existing, pretty big codebase? What were the main challenges that we encountered, and how did we solve them? What are the key take-outs from our integrations? I will answer these and a few more questions during this presentation.
A brief introduction to the Declarative Schema introduced into Magento 2.3.
This presentation covers:
- What developers were required to do previously
- The benefits of using Declarative Schema
- How to create tables
- How to rename tables
- How to drop tables
- Table attributes
- Adding columns
- Column attributes
- Indexes
- Unique values within columns
- Primary keys
- Foreign keys
- Data patches and how to create them
- Schema patches and how to create them
First Steps in Drupal Code Driven DevelopmentNuvole
"First Steps in Code Driven Development" covers basic techniques and good practices. Presented during the "Developer Session" at Krimson office, Antwerp (BE), the 27th of May 2010.
By the sum of PHPUnit assertion power and Symfony2 functional testing tools the developer can obtain a deep control on the developed application.
Here you can find some suggestions on how to leverage that power.
Un gioco in cui vincono tutti o due piccioni con una fava ;)
Lavorare rivolti alla creazione di valore per il cliente e da questo ottenere una libreria quasi pronta per essere pubblicata
Silex is a brand new PHP 5.3 micro framework built on top of the Symfony2 de decoupled components. In this session, we will discover how to build and deploy powerful REST web services with such a micro framework and its embedded tools.
The first part of this talk will introduce the basics of the REST architecture. We fill focus on the main concepts of REST like HTTP methods, URIs and open formats like XML and JSON.
Then, we will discover how to deploy REST services using most of interesting Silex tools like database abstraction layer, template engine and input validation. We will also look at unit and functional testing frameworks with PHPUnit and HTTP caching with Edge Side Includes and Varnish support to improve performances.
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceIvan Chepurnyi
It is a pity, but I have to admit, that Magento 2 has issues in layout generation process. You'll learn during the talk about the benefits of compiling XML structures into PHP code, and even use the compilation of PHP code into PHP code to speed up your modules complex logic.
Sylius and Api Platform The story of integrationŁukasz Chruściel
Being a part of the Symfony ecosystem gives access to the vast number of open-source solutions built on top. A lot of people voluntarily committed the time to make impressive, multipurpose solutions. One of these solutions is the API Platform, the most mature framework for API development.
In Sylius, it was always our goal to take advantage of the best of the breed and integrate with others. Keeping this in mind, we have decided to combine both projects and deliver a new quality in the headless e-commerce world.
How did it go to integrate new infrastructure to the existing, pretty big codebase? What were the main challenges that we encountered, and how did we solve them? What are the key take-outs from our integrations? I will answer these and a few more questions during this presentation.
A brief introduction to the Declarative Schema introduced into Magento 2.3.
This presentation covers:
- What developers were required to do previously
- The benefits of using Declarative Schema
- How to create tables
- How to rename tables
- How to drop tables
- Table attributes
- Adding columns
- Column attributes
- Indexes
- Unique values within columns
- Primary keys
- Foreign keys
- Data patches and how to create them
- Schema patches and how to create them
First Steps in Drupal Code Driven DevelopmentNuvole
"First Steps in Code Driven Development" covers basic techniques and good practices. Presented during the "Developer Session" at Krimson office, Antwerp (BE), the 27th of May 2010.
By the sum of PHPUnit assertion power and Symfony2 functional testing tools the developer can obtain a deep control on the developed application.
Here you can find some suggestions on how to leverage that power.
Un gioco in cui vincono tutti o due piccioni con una fava ;)
Lavorare rivolti alla creazione di valore per il cliente e da questo ottenere una libreria quasi pronta per essere pubblicata
Silex is a brand new PHP 5.3 micro framework built on top of the Symfony2 de decoupled components. In this session, we will discover how to build and deploy powerful REST web services with such a micro framework and its embedded tools.
The first part of this talk will introduce the basics of the REST architecture. We fill focus on the main concepts of REST like HTTP methods, URIs and open formats like XML and JSON.
Then, we will discover how to deploy REST services using most of interesting Silex tools like database abstraction layer, template engine and input validation. We will also look at unit and functional testing frameworks with PHPUnit and HTTP caching with Edge Side Includes and Varnish support to improve performances.
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceIvan Chepurnyi
It is a pity, but I have to admit, that Magento 2 has issues in layout generation process. You'll learn during the talk about the benefits of compiling XML structures into PHP code, and even use the compilation of PHP code into PHP code to speed up your modules complex logic.
28.03.15. Одесса. Impact Hub Odessa. Конференция JSLab.
Алексей Волков. "React на практике"
Доклад освещает практические аспекты использования React.js в различном окружении. React и модели Backbone. React и таблицы стилей, а также React в мобильном вебе. Будет полезно как и тем, кто только интересуется этой библиотекой, а также опытным разработчикам.
Подробнее:
http://geekslab.co/
https://www.facebook.com/GeeksLab.co
https://www.youtube.com/user/GeeksLabVideo
Spring and Cloud Foundry; a Marriage Made in HeavenJoshua Long
Spring and Cloud Foundry: a Marriage Made in Heaven. This talk introduces how to build Spring applications on top of Cloud Foundry, the open source PaaS from VMware
I present four design patterns that make your development easier and better. Design patterns are a fantastic way to make more readable code, as they make use of common ideas that many developers know and use. These patterns are tried and tested in the enterprise world.
The first one is dependency injection. This covers putting the variables that a class needs to function preferably inside a constructor.
The second one is the factory pattern. A factory moves the responsibility of instantiating an object to a third-party class.
The third one is dependency injection. This allows us to place a class' dependencies at one time, making it easy to come back and see what the class needs to survive.
Finally, we discuss the chain of responsibility. This allows complex operations to be handled by a chain of classes. Each class in the chain determines whether it is capable of handling the request and, if so, it returns the result.
This talk represents the combined experience from several web development teams who have been using Symfony2 since months already to create high profile production applications. The aim is to give the audience real world advice on how to best leverage Symfony2, the current rough spots and how to work around them. Aside from covering how to implement functionality in Symfony2, this talk will also cover topics such as how to best integrate 3rd party bundles and where to find them as well as how to deploy the code and integrate into the entire server setup.
Inclusive Design: Thinking beyond accessibilityMichael Miles
There are many differences that impact the way people experience the digital world. From age and gender, vision and dexterity, to location and education. Each difference affects digital inclusion and experiences. As Drupalists it is our job to build products that are usable by, and inclusive of, as many people as possible. To do so, it is important that we plan for the many differences that make up our users.
This session details the importance of having an inclusive mindset in the creation of our digital projects. It explains how Inclusive Design allow for producing positive experiences for a wider audience. Attendees will learn four simple guidelines that they can follow to apply Inclusive Design principles across all project phases including: ux, development and content creation. Attendees will leave with the tools they need to reach a bigger user base while also building towards an accessible and inclusive digital world.
The success of a project is not just the result of the framework that is chosen or the lines of code that are written. Success is also determined by the team of people that work on a project and how they operate as a cohesive unit. To execute with repeated project successes, it’s imperative to first build successful and productive teams.
How does one create an environment of productivity and success in their respective teams? The answer lies in fostering the growth of four key attributes; Communication, Collaboration, Positivity, Responsibility.
This session will explore aforementioned attributes and outline why they are essential to continued team success. Explaining why each attribute matters and how it builds trust and excellence within a team. Attendees of this session will leave with the knowledge of how to foster these qualities within their own team.
How to Foster Team Success | Drupalcon 2017Michael Miles
The success of a project is not just the result of the framework that is chosen or the lines of code that are written. Success is also determined by the team of people that work on a project and how they operate as a cohesive unit. To execute with repeated project successes, it’s imperative to first build successful and productive teams.
How does one create an environment of productivity and success in their respective teams? The answer lies in fostering the growth of four key attributes; Communication, Collaboration, Positivity and Responsibility.
This session will explore aforementioned attributes and outline why they are essential to continued team success. Explaining why each attribute matters and how it builds trust and excellence within a team.
Inclusive Design: Thinking Beyond Accessibility | NERDSummit 2017Michael Miles
There are many differences that impact the way people experience the digital world. From age and gender, vision and dexterity, to location and education. Each difference affects digital inclusion and experiences. As builders of the digital world it is our job to build products that are usable by, and inclusive of, as many people as possible. To do so, it is important that we plan for the many differences that make up our users.
This session details the importance of having an inclusive mindset in the ux and content aspects of our digital projects. It explains how Inclusive Design allow for producing positive experiences for a wider audience. Attendees will learn four simple guidelines that they can follow to apply Inclusive Design principles to their ux and content phases. Attendees will leave with the tools they need to reach a bigger user base while also building towards an accessible and inclusive digital world.
This session is intended for anyone who wants to build digital products that reach as many people as possible.
Inclusive Design: Thinking Beyond Accessibility | DCNL 2017Michael Miles
There are many differences that impact the way people experience the digital world, including (but not lmited to) age, gender, vision, dexterity, location, and education. Each difference affects digital inclusion and experiences. As creators of the digital world it is our job to build products that are usable by, and inclusive of, as many people as possible. To do so, it is important that we plan for the many differences that make up our users. Inclusive Design is the process of creating products and/or services that are accessible to, and usable by, as many people as reasonably possible ... without the need for special adaptation or specialised design.
This session details the importance of having an inclusive mindset in the ux and content aspects of our digital projects. It explains how Inclusive Design allow for producing positive experiences for a wider audience. Attendees will learn four simple guidelines that they can follow to apply Inclusive Design principles to their ux and content phases. Attendees will leave with the tools they need to reach a bigger user base while also building towards an accessible and inclusive digital world.
This session is intended for anyone who wants to build digital products that reach as many people as possible.
The Flexibility of Drupal 8 | DCNLights 2017Michael Miles
In this session we will demonstrate the flexibility of Drupal by going over 8 different ways in Drupal 8 that data can be manipulated. From non-technical methods, "frontend" javascript & templating methods, to "Backend" methods such as building a custom module and overriding services. This session will demonstrate how to implement each one outlining their individual pros and cons, proving that no matter your skill sets you can make Drupal 8 do what you want.
INCLUSIVE DESIGN: Going beyond AccessibilityMichael Miles
People are not ones(1) and zeros(0) and the world is not just black and white. Everyone identifies themselves differently and while it may be impossible to cater to everyones needs, it is important that we strive to make our websites, applications and tools as inclusive as possible.
Inclusive Design is a form of accessibility. It is the concept of begin mindful in making technology available to and usable by all people whatever their abilities, age, economic situation, orientation, language, etc...
In this session we will talk about some of the ways to think about inclusive design on your projects and why it is important. We will discuss what questions and conversations to have with clients, what considerations to think about when planning the UX and design of your site and what architectural decisions to think about when building your site. Along the way we will look at examples of inclusive design in the wild and the benefits they offer.
In this session we will talk about some of the ways to think about inclusive design on your projects and why it is important. We will discuss what questions and conversations to have with clients, what considerations to think about when planning the UX and design of your site and what architectural decisions to think about when building your site. Along the way we will look at examples of inclusive design in the wild and the benefits they offer.
No other CMS offers more flexibility then Drupal. If you need to implement a piece of functionality or change a piece of data, there are a million different ways you can go about it. However, this flexibility can also be daunting and frustrating.How do you know if you are going about your changes the “right" way? The truth of the matter is that there is no “right" way - just the “right for me” way. Any method you choose will come with it’s own sets of drawbacks and benefits.
In this session we will demonstrate the flexibility of Drupal by going over 8 different ways in Drupal 8 that data can be manipulated. From non-technical methods, "frontend" javascript & templating methods, to "Backend" methods such as building a custom module and overriding services. This session will demonstrate how to implement each one outlining their individual pros and cons, proving that no matter your skill sets you can make Drupal 8 do what you want.
No other CMS offers more flexibility then Drupal. If you need to implement a piece of functionality or change a piece of data, there are a million different ways you can go about it. However, this flexibility can also be daunting and frustrating. How do you know if you are going about your changes the “right" way? The truth of the matter is that there is no “right" way - just the “right for me” way. Any method you choose will come with it’s own sets of drawbacks and benefits. In this session we will demonstrate the flexibility of Drupal by going over 8 different ways in Drupal 8 that data can be manipulated. From non-technical methods, "frontend" javascript & templating methods, to "Backend" methods such as building a custom module. This session will demonstrate how to implement each one and outline their individual pros and cons.
Badcamp 2015 - R.E.A.D: Four Steps for Selecting The Right ModulesMichael Miles
One of the most crucial and important steps in building any Drupal project is how to determine which modules to use. When you are reviewing your functionality needs you may ask yourself:
- Where and how can I find the modules I need?
- Will this module I found solve my functionality needs?
- Will I need to patch this module?
- Should I just write my own custom module?
To quickly and correctly answer these questions, there are four simple steps you should follow. It's as simple as learning how to R.E.A.D.
This session goes over the four steps of R.E.A.D, which can help you to quickly and correctly identify which module fits your functionality needs, if you should patch a contrib module or if you should write your own custom module.
This session will use real world examples of using the steps of R.E.A.D to make module decisions. We will also cover the basics and best practices of writing patches and custom modules and how to contribute them back to the Drupal community.
This session is geared towards developer, site builders and functionality decision makers who consider themselves new to Drupal. This session can also prove to be beneficial to experienced drupalists who want to validate/improve habits they have developed.
No other CMS offers more flexibility then Drupal. If you need to implement a piece of functionality or change a piece of data, there are a million different ways you can go about it. However, this flexibility can also be daunting and frustrating. How do you know if you are going about your changes the “right" way?
The truth of the matter is that there is no “right" way - just the “right for me” way. Any method you choose will come with it’s own sets of drawbacks and benefits.
In this session we will demonstrate the flexibility of Drupal by going over 9 different ways (across Drupal 7 and Drupal 8) that data can be manipulated. From a backend only solution to a front-end only solution, a “Drupal friendly” way to a “hacky” way, using a contrib module to writing a custom module. This session will demonstrate how to implement each one and outline their individual pros and cons.
No other CMS offers more flexibility then Drupal. If you need to implement a piece of functionality or change a piece of data, there are a million different ways you can go about it. However, this flexibility can also be daunting and frustrating. How do you know if you are going about your changes the “right way”?
The truth of the matter is that there is no “right way” - just the “right for me” way. Any method you choose will come with it’s own sets of drawbacks and benefits.
One of the most common elements manipulated in Drupal are menu items. Changing destinations, titles, styling, display and order, there are many ways a menu item may be altered and many ways to going about doing so.
In this session we will demonstrate the flexibility of Drupal by going over 9 different ways (across Drupal 7 and Drupal 8) that a menu item could be manipulated. From a backend only solution to a front-end only solution, a “Drupal friendly” way to a “hacky” way, using a contrib module to writing a custom module. This session will demonstrate how to implement each one and outline their individual pros and cons.
Flcamp2015 - R.E.A.D: Four steps for selecting the right modulesMichael Miles
One of the most crucial and important steps in building any Drupal project is determing which modules to use. When you are reviewing your functionality needs you may ask yourself:
Where and how can I find the modules I need?
Will this module I found solve my functionality needs?
Will I need to patch this module?
Should I just write my own custom module?
To quickly and correctly answer these questions, there are four simple steps you should follow. It's as simple as learning how to R.E.A.D.
This session goes over the four steps of R.E.A.D, which can help you to quickly and correctly identify which module fits your functionality needs, if you should patch a contrib module or if you should write your own custom module.
This session will use real world examples of using the steps of R.E.A.D to make module decisions. We will also cover the basics and best practices of writing patches and custom modules and how to contribute them back to the Drupal community.
This session is geared towrds developer, site builders and functionality decision makers who consider themselves new to Drupal. This session can also prove to be beneficial to experienced drupalists who want to validate/improve habits they have developed.
R.E.A.D: Four steps for selecting the right modules Midcamp 2015Michael Miles
One of the most crucial and important steps in building any Drupal project is determing which modules to use. When you are reviewing your functionality needs you may ask yourself:
Where and how can I find the modules I need?
Will this module I found solve my functionality needs?
Will I need to patch this module?
Should I just write my own custom module?
To quickly and correctly answer these questions, there are four simple steps you should follow. It's as simple as learning how to R.E.A.D.
This session goes over the four steps of R.E.A.D, which can help you to quickly and correctly identify which module fits your functionality needs, if you should patch a contrib module or if you should write your own custom module.
This session will use real world examples of using the steps of R.E.A.D to make module decisions. We will also cover the basics and best practices of writing patches and custom modules and how to contribute them back to the Drupal community.
This session is geared towrds developer, site builders and functionality decision makers who consider themselves new to Drupal. This session can also prove to be beneficial to experienced drupalists who want to validate/improve habits they have developed.
How to R.E.A.D: Steps for how to select the correct module @NEWDCamp 2014Michael Miles
To use a contrib module, patch a contrib module or write a custom module, that is the question. With over 27,000 contrib modules available for download it is rare to find one that does not offer the functionality you are looking for. However, when you cannot find a module that fits your needs you are then faced with a choice. Do you patch an existing contrib module? Or write a custom module?
To figure out the answer to the questions you just need to remember to R.E.A.D. This session goes over the four steps of R.E.A.D that help you decide which path you should follow and how you can quickly and correctly identify if you should patch a contrib module or write your own custom module.
This session use some real world examples to demo straight how these steps were utilized to make the correct decision. This session also talk about the basics and best practices of writing and contributing a patch, and the best practices to follow if you decide to pursue writing a custom module and how to contribute it back to the Drupal community.
This session is geared to developer, site builders and functionality decision makers who consider themselves new to Drupal. This session can also prove to be beneficial to experienced drupalists who want validation on habits they have developed over time.
To Patch or Custom: How to decide when to patch a contrib module or go custom...Michael Miles
To use a contrib (community) module, patch a contrib module or write a custom module, that is the question.
With over 25,000 community contributed modules available for download it is rare to find one that does not offer the functionality you are looking for. However, when you cannot find a module that fits your needs you are then faced with a choice. Do you patch an existing contrib module? Or write a custom one?
To figure out the answer to the answer you just need to remember to R.E.A.D.
In this session we will go over the four steps of R.E.A.D that help you decide which path you should follow and how you can quickly and correctly identify if you should patch a contrib module or write your own custom module. We will use some real world examples to demo straight how these steps were utilized to make the correct decision.
We will also talk about the basics and best practices of writing and contributing a patch, and the best practices to follow if you decide to pursue writing a custom module and how to contribute it back to the Drupal community.
This session is geared to developer, site builders and functionality decision makers who consider themselves new to Drupal. This session can also prove to be beneficial to experienced drupalists who want validation on habits they have developed over time.
1.Wireless Communication System_Wireless communication is a broad term that i...JeyaPerumal1
Wireless communication involves the transmission of information over a distance without the help of wires, cables or any other forms of electrical conductors.
Wireless communication is a broad term that incorporates all procedures and forms of connecting and communicating between two or more devices using a wireless signal through wireless communication technologies and devices.
Features of Wireless Communication
The evolution of wireless technology has brought many advancements with its effective features.
The transmitted distance can be anywhere between a few meters (for example, a television's remote control) and thousands of kilometers (for example, radio communication).
Wireless communication can be used for cellular telephony, wireless access to the internet, wireless home networking, and so on.
Italy Agriculture Equipment Market Outlook to 2027harveenkaur52
Agriculture and Animal Care
Ken Research has an expertise in Agriculture and Animal Care sector and offer vast collection of information related to all major aspects such as Agriculture equipment, Crop Protection, Seed, Agriculture Chemical, Fertilizers, Protected Cultivators, Palm Oil, Hybrid Seed, Animal Feed additives and many more.
Our continuous study and findings in agriculture sector provide better insights to companies dealing with related product and services, government and agriculture associations, researchers and students to well understand the present and expected scenario.
Our Animal care category provides solutions on Animal Healthcare and related products and services, including, animal feed additives, vaccination
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC
Ellisha Heppner, Grant Management Lead, presented an update on APNIC Foundation to the PNG DNS Forum held from 6 to 10 May, 2024 in Port Moresby, Papua New Guinea.
This 7-second Brain Wave Ritual Attracts Money To You.!nirahealhty
Discover the power of a simple 7-second brain wave ritual that can attract wealth and abundance into your life. By tapping into specific brain frequencies, this technique helps you manifest financial success effortlessly. Ready to transform your financial future? Try this powerful ritual and start attracting money today!
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBrad Spiegel Macon GA
Brad Spiegel Macon GA’s journey exemplifies the profound impact that one individual can have on their community. Through his unwavering dedication to digital inclusion, he’s not only bridging the gap in Macon but also setting an example for others to follow.
3. Goals of this Session
Explain AJAX callback commands
Demonstrate AJAX callback commands
Outline custom AJAX callback commands
4. What are Callback Commands
Functions returned and invoked by all Ajax responses
Allow server to dictate client functionality
Defined by Drupal core (25) and Modules
5. Callback Commands: Server Side
Follows naming convention [CommandName]Command(.php)
Class that implements CommandInterface
Defines a 'render' method
Returns an associative array
Contains element with key of 'command'
'Command' value is name of JavaScript method
6. Anatomy of a Callback Command: PHP
01 use DrupalCoreAjaxCommandInterface;
02
03 // An AJAX command for calling [commandName]() JavaScript method.
04 class [CommandName]Command implements CommandInterface {
05
06 // Implements DrupalCoreAjaxCommandInterface:render().
07 public function render() {
08 return array(
09 'command' => '[commandName]', // Name of JavaScript Method.
10 // other request arguments...
11 );
12 }
13 }
[CommandName]Command.php
Callback command classes need to implement CommandInterface (lines #1 & #4). Must define a 'render'
method (lines #7 #12), that returns an associative array. Associative array must contain an element
with the key of 'command' and a vlaue that is a name of the javascript method. Additional arguments are
passed as response data.
7. Callback Commands: Client Side
Wrapper for additional javascript
Method attached to 'Drupal.AjaxCommands.prototype' object
Takes 3 arguments
ajax
response
status
8. Anatomy of a Callback Command: JavaScript
01 /**
02 * [commandName description]
03 *
04 * @param {Drupal.Ajax} [ajax]
05 * @param {object} response
06 * @param {number} [status]
07 */
08 Drupal.AjaxCommands.prototype.[commandName] = function(ajax, response, status){
09
10 // Custom javascript goes here ...
11
12 }
Callback Command needs to be attached as a method to the Drupal.AjaxCommands.prototype object
(line #8). Command accepts three arguments and is a wrapper for additional javascript.
10. How to Use Callback Commands
Attach Drupal Ajax library to the requesting page
Create a callback method that returns an AjaxResponse object
Attach commands to AjaxResponse object using 'addCommand'
11. Example: The "Remove" Command
Example of using the remove callback command. Link triggers ajax request which returns response with
'remove' command targeting image id.
12. 01 namespace Drupalremove_exampleController;
02 use DrupalCoreControllerControllerBase;
03
04 class RemoveExampleController extends ControllerBase {
05
06 // Return output for displaying an image and ajax link for removing it.
07 public static function demo() {
08 $output['description']['#markup'] = '<p>' . t('The following is an example of using
09 // ...
10 // Attach the ajax library.
11 $output['#attached']['library'][] = 'core/drupal.ajax';
12 // Return render array
13 return $output;
14 }
15 // ...
16 }
remove_example/src/Controller/RemoveExampleController.php
Pages that want to use Ajax need to include the ajax library. On line #11 attaching the core Drupal Ajax
library to the render array for the page.
13. 01 namespace Drupalremove_exampleController;
02 use DrupalCoreControllerControllerBase;
03 use DrupalCoreAjaxAjaxResponse;
04 use DrupalCoreAjaxRemoveCommand;
05
06 class RemoveExampleController extends ControllerBase {
07 // ...
08 /**
09 * Callback method for removing image from 'remove-example' page.
10 *
11 * @return DrupalCoreAjaxAjaxResponse|mixed
12 */
13 public static function removeImage() {
14 // Create an Ajax Response object.
15 $response = new AjaxResponse();
16 // Add a remove command.
17 $response->addCommand(new RemoveCommand('#example_remove_wrapper'));
18 // Return the response object.
19 return $response;
20 }
21 }
remove_example/src/Controller/RemoveExampleController.php
Classes used for Ajax requests need to include needed classes (line #3, Line #4). Callback method needs
to return an ajax command (line #14) and attach commands using 'addCommand' method (line #16).
14. To Use Callback Commands...
Attach Drupal Ajax library to the requesting page
Create callback method that returns AjaxResponse
Attach commands to AjaxResponse object with 'addCommand'
15. Creating Custom Callback Commands
Requires a custom module
Need to define custom php classes
Need to define custom javascript methods
16. Custom Callback Commands: PHP
Follow naming convention [CommandName]Command(.php)
Implement CommandInterface
Define a 'render' method
Return an associative array with 'command' element
Place in 'src/Ajax/' directory of module
17. Example: SlideRemoveCommand
01 namespace Drupalremove_exampleAjax;
02
03 use DrupalCoreAjaxCommandInterface;
04 // An AJAX command for calling the jQuery slideUp() and remove() methods.
05 class SlideRemoveCommand implements CommandInterface {
06 // Constructs an SlideRemoveCommand object.
07 public function __construct($selector, $duration = NULL) {
08 $this->selector = $selector;
09 $this->duration = $duration;
10 }
11 // Implements DrupalCoreAjaxCommandInterface:render().
12 public function render() {
13 return array(
14 'command' => 'slideRemove',
15 'selector' => $this->selector,
16 'duration' => $this->duration,
17 );
18 }
19 }
remove_example/src/Ajax/SlideRemoveCommand.php
An example of creating a custom 'SlideRemove' callback command PHP Class. Class follows naming
conventions and implements CommandInterface (line #5). Defines a render method (line #12), which
returns an associative array with a 'command' keyed element. (lines #13 #17).
18. Custom Callback Commands: JavaScript
Attach method to 'Drupal.AjaxCommands.prototype' object
Take 3 arguments
ajax
response
status
Add JavaScript to a custom library
19. Example: slideRemove
01 (function ($, window, Drupal, drupalSettings) {
02 'use strict';
03 // Command to slide up content before removing it from the page.
04 Drupal.AjaxCommands.prototype.slideRemove = function(ajax, response, status){
05 var duration = response.duration ? response.duration : "slow";
06
07 $(response.selector).each(function() {
08 $(this).slideUp(duration, function() {
09 $(this).remove();
10 });
11 });
12 }
13 })(jQuery, this, Drupal, drupalSettings);
remove_example/js/ajax.js
An example of creating a custom 'slideRemove' callback command javascript method. Attached to
'Drupal.AjaxCommands.prototype' object and accepts three arguments (line #4). Uses response data for
additional javascript functionality (lines #5 #13).
20. Example: remove_example/remove-example library
01 remove-example:
02 version: VERSION
03 js:
04 js/ajax.js: {}
05 dependencies:
06 - core/drupal.ajax
remove_example.libraries.yml
Javascript file that contains custom 'slideRemove' command is added to a library deffinition (lines #3
#4). Add core Drupal Ajax library as a dependency so that it is included (lines #5 #6).
21. To Create Custom Callback Commands...
Use a custom module
Define classes that implements CommandInterface
Attach JavaScript method(s) to 'Drupal.AjaxCommands.prototype'
22. Using Custom Callback Commands
Attach custom library to the requesting page
Attach commands to AjaxResponse object with 'addCommand'
23. Example: The "slideRemove" Command
Example of using the custom slideRemove callback command. Link triggers ajax request which returns
response with 'slideRemove' command targeting image id.
24. 01 namespace Drupalremove_exampleController;
02 use DrupalCoreControllerControllerBase;
03
04 class RemoveExampleController extends ControllerBase {
05
06 // Return output for displaying an image and ajax link for removing it.
07 public static function demo() {
08 $output['description']['#markup'] = '<p>' . t('The following is an example of using
09 // ...
10 // Attach custom Ajax command library.
11 $output['#attached']['library'][] = 'remove_example/remove-example';
12 // Return render array
13 return $output;
14 }
15 // ...
16 }
remove_example/src/Controller/RemoveExampleController.php
Custom Javascript library needs to be included on requesting page, so that methods are attached.
Attaching library to render array on line #11.
25. 01 namespace Drupalremove_exampleController;
02 use DrupalCoreControllerControllerBase;
03 use DrupalCoreAjaxAjaxResponse;
04 use DrupalCoreremove_exampleSlideRemoveCommand;
05
06 class RemoveExampleController extends ControllerBase {
07 // ...
08 /**
09 * Callback method for removing image from 'remove-example' page.
10 *
11 * @return DrupalCoreAjaxAjaxResponse|mixed
12 */
13 public static function removeImage() {
14 // Create an Ajax Response object.
15 $response = new AjaxResponse();
16 // Add a remove command.
17 $response->addCommand(new SlideRemoveCommand('#example_remove_wrapper', 'slow'
18 // Return the response object.
19 return $response;
20 }
21 }
remove_example/src/Controller/RemoveExampleController.php
Like core callback commands, custom command classes have to be included in callback controller (line
#4) and added to AjaxResponse in callback method (line #17).
26. To Use Custom Callback Commands...
Attach custom library to the requesting page
Attach commands to AjaxResponse object with 'addCommand'
28. AJAX Callback Commands Are...
Functions returned and invoked by all Ajax responses
PHP Classes implementing CommandInterface
Methods attached to 'Drupal.AjaxCommands.prototype' object
29. To Use AJAX Callback Commands...
Attach Drupal Ajax library to the requesting page
Create callback method that returns AjaxResponse
Attach commands to AjaxResponse object with 'addCommand'
30. To Create AJAX Callback Commands...
Use a custom module
Define classes that implements CommandInterface
Attach JavaScript methods to 'Drupal.AjaxCommands.prototype'
31. To Use Custom AJAX Callback Commands...
Attach custom library to the requesting page
Same process as using core commands