SlideShare une entreprise Scribd logo
1  sur  12
Well Come to all of you in Drupal (CMS) Session . Developed By. Kunal Guide by: Amit What is Drupal? Drupal is used to build web sites. It’s a highly modular, open source web content management framework Last Updated: October 17 2007
Generally there are four types of files in drupal we used. These files extension are 1) .CSS 2) .Info 3) .Install 4) .Module Shortly introduction about above files. 1) .Css :-> Use of css files for change the layout of that perticular module. 2) .Info :-> This file is like the .ini file in windows.  the concept of a .info file has been introduced to give Drupal a little more information about your module. 3) .Module :-> Total Functionality about your module. Last Updated: October 17 2007
MODULES:   Drupal is a truly modular framework. Functionality is included in modules, which can be enabled or disabled (some required modules cannot be disabled). Features are added to a Drupal web site by enabling existing modules, installing modules written by members of the Drupal community,or writing new modules. Drupal makes use of the inversion of control design pattern, in which modular functionality is called by the framework at the appropriate time. These opportunities for modules to do their thing are called hooks. Hooks: Hooks can be thought of as internal Drupal events. They are also called callbacks, though because they are constructed by function naming conventions and not by registering with a listener, they are not truly being called back. Hooks allow modules to “hook into” what is happening in the rest of Drupal.Suppose a user logs into your Drupal web site. At the time the user logs in, Drupal fires the user hook. That means that any function named according to the convention module name plus hook name will be called. Blocks: A block is information that can be enabled or disabled in a specific location on your web site’s template. For example, a block might display the number of current active users on your site.You might have a block containing the most active users, or a list of upcoming events. Blocks are typically placed in a template’s sidebar, header, or footer. Blocks can be set to display on nodes of a certain type, only on the front page, or according to other criteria. Last Updated: October 17 2007
.Info :->   This file is like the .ini file in windows.  the concept of a .info file has been introduced to give Drupal a little more information about your module.This file is used  primarily by the modules administration system for display purposes as well as providing criteria to control activation and deactivation. This file is required for Drupal 5 to recognize the presence of a module.The .info file should have the same name as the .module file and reside in the same directory. For example, if your module is named example.module then your .info file should be named example.info.info files may contain comments. The comment character is the semi-colon and denotes a comment until the end of the line. A comment may begin at any point on the line, thus it is especially important you quote any string that contains a comment. It is typical to place the CVS Id at the top of a .info file using a comment: The .info file can contain the following fields:  A) name (Required):   The displayed name of your module. It should follow the Drupal 5 capitalization standard: only the first letter of the first word is capitalized  Ex. name = &quot;Forum&quot; B) description (Required) :  A short, preferably one line description that will tell the administrator what this  module does on the module administration page. Remember, overly long descriptions can make this page difficult to work with, so please try to be concise. This field is limited to 255 characters.Ex. description = &quot;Enables threaded discussions about general topics.“ If your .info file's description (or other field) contains characters other than alphanumeric values then you must quote the string. If you need to use &quot; in the string then you need to use the &quot; value to display the &quot; character.For example, this will display correctly: description = &quot;This is my &quot;crazy@email.com&quot; email address“ This is wrong and cause Drupal to display an error when going to the modules menu:description = This is my &quot;crazy@email.com&quot; address <- DO NOT DO THIS Last Updated: October 17 2007 Next Page Next Page
C) dependencies (Optional):    A space separated list of other modules that your module requires. If these modules are not present, your module can not be enabled. If these modules are present but not enabled, the administrator will be prompted with a list of additional modules to enable and may choose to enable the required modules as well, or cancel at that point. Ex. dependencies = taxonomy comment D) package (Optional):  If your module comes with other modules or is meant to be used exclusively with other modules, enter the name of the package here. If left blank, the module will be listed as 'Other'.  Ex. package = Views  Suggested examples of appropriate items for the package field: 1) Chat 2) Location 3) View 4) Event 5) Video E) version (Optional): Display the version of your modules. Ex. version = 1.1 F) project (packaging use only):  Module maintainers should not use this at all. The packaging script on drupal.org will automatically place a string here to identify what project the module came from. This is primarily for the Update status module, so that Drupal installations can monitor versions of installed packages and notify administrators when new versions are available. Last Updated: October 17 2007
3) .Install :-> .install files to do module setup work. A .install file is run the first time a module is enabled, and is used to do setup required  by the module. The most common task is creating database tables and fields . .install files are also used to perform updates when a new version of a module needs it. There are three functions in .install files. 1) _install() 2) _Update_x() 3) _Uninstall() Use of _install() function is to install the or create the tables in your database. There are two types of labraries/Packages are used by Drupal. These are MySqli & PgSql Note about already installed modules If the module you are writing the .install file for is already installed then the install/update(s) will not trigger even if you disable/enable it. You need to disable the module and remove its record manually form the system table or include a hook_uninstall function. Last Updated: October 17 2007 Next Page Next Page
Syntax For _Install(): function xyz_install() { switch ($GLOBALS['db_type']) { case 'mysql': case 'mysqli': db_query(&quot;CREATE TABLE {xyz_data} ( vid int unsigned NOT NULL default '0', field_name varchar(32) NOT NULL default '')); break; case 'pgsql': db_query(&quot;CREATE TABLE {xyz_data} ( vid serial CHECK (vid >= 0), field_name varchar(32) NOT NULL default '')); db_query(&quot;CREATE INDEX {xyz_data}_field_name_idx ON {xyz_data} (field_name)&quot;); break; } } Last Updated: October 17 2007 Next Page Next Page
use of _update_x(): .install files can also include update instructions, which are used through update.php like regular Drupal updates. Each update is placed in a modulename_update_x() function (where x is an incrementing integer). Updates should always increment by 1. Syntax For _update_x(): function example_update_1() { $items = array(); $items[] = update_sql(&quot;ALTER TABLE {example} ADD new_column text&quot;); $items[] = update_sql(&quot;ALTER TABLE {example} DROP old_column&quot;); return $items; } Last Updated: October 17 2007 Next Page Next Page
The _uninstall function is also available in a .install file and gets fired when a module is  uninstalled.  This function generally includes dropping tables and deleting variables specific to that module. Syntax _uninstall(): function search_uninstall() { db_query('DROP TABLE {xyz_data}'); db_query('DROP TABLE {xyz_index}'); db_query('DROP TABLE {search_total}'); variable_del('minimum_word_size'); variable_del('overlap_cjk'); } Last Updated: October 17 2007 Next Page Next Page
In Your .Module files you use the hook’s as a function name. suppose _help is the name of your hook then the name of function should be xyz_help() And the xyz is name of your module. There are certain rules while writing the modules. Last Updated: October 17 2007
[object Object],(.Module) File Last Updated: October 17 2007
[object Object],Last Updated: October 17 2007 Thank You Any Questions?

Contenu connexe

Tendances

香港六合彩
香港六合彩香港六合彩
香港六合彩iewsxc
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4than sare
 
R12 d49656 gc10-apps dba 27
R12 d49656 gc10-apps dba 27R12 d49656 gc10-apps dba 27
R12 d49656 gc10-apps dba 27zeesniper
 
20100622 e z_find_slides_gig_v2.1
20100622 e z_find_slides_gig_v2.120100622 e z_find_slides_gig_v2.1
20100622 e z_find_slides_gig_v2.1Gilles Guirand
 
My sql with querys
My sql with querysMy sql with querys
My sql with querysNIRMAL FELIX
 
Java 7 Features and Enhancements
Java 7 Features and EnhancementsJava 7 Features and Enhancements
Java 7 Features and EnhancementsGagan Agrawal
 
R12 d49656 gc10-apps dba 10
R12 d49656 gc10-apps dba 10R12 d49656 gc10-apps dba 10
R12 d49656 gc10-apps dba 10zeesniper
 
R12 d49656 gc10-apps dba 05
R12 d49656 gc10-apps dba 05R12 d49656 gc10-apps dba 05
R12 d49656 gc10-apps dba 05zeesniper
 
R12 d49656 gc10-apps dba 12
R12 d49656 gc10-apps dba 12R12 d49656 gc10-apps dba 12
R12 d49656 gc10-apps dba 12zeesniper
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questionsNaveen P
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview QuestionsNaveen P
 
R12 d49656 gc10-apps dba 18
R12 d49656 gc10-apps dba 18R12 d49656 gc10-apps dba 18
R12 d49656 gc10-apps dba 18zeesniper
 

Tendances (19)

香港六合彩
香港六合彩香港六合彩
香港六合彩
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4
 
R12 d49656 gc10-apps dba 27
R12 d49656 gc10-apps dba 27R12 d49656 gc10-apps dba 27
R12 d49656 gc10-apps dba 27
 
Sqlmap
SqlmapSqlmap
Sqlmap
 
20100622 e z_find_slides_gig_v2.1
20100622 e z_find_slides_gig_v2.120100622 e z_find_slides_gig_v2.1
20100622 e z_find_slides_gig_v2.1
 
plsql Les05
plsql Les05 plsql Les05
plsql Les05
 
My sql with querys
My sql with querysMy sql with querys
My sql with querys
 
Java 7 Features and Enhancements
Java 7 Features and EnhancementsJava 7 Features and Enhancements
Java 7 Features and Enhancements
 
R12 d49656 gc10-apps dba 10
R12 d49656 gc10-apps dba 10R12 d49656 gc10-apps dba 10
R12 d49656 gc10-apps dba 10
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
Formats
FormatsFormats
Formats
 
R12 d49656 gc10-apps dba 05
R12 d49656 gc10-apps dba 05R12 d49656 gc10-apps dba 05
R12 d49656 gc10-apps dba 05
 
R12 d49656 gc10-apps dba 12
R12 d49656 gc10-apps dba 12R12 d49656 gc10-apps dba 12
R12 d49656 gc10-apps dba 12
 
Sqlmap
SqlmapSqlmap
Sqlmap
 
plsql les03
 plsql les03 plsql les03
plsql les03
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questions
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview Questions
 
Power shell
Power shellPower shell
Power shell
 
R12 d49656 gc10-apps dba 18
R12 d49656 gc10-apps dba 18R12 d49656 gc10-apps dba 18
R12 d49656 gc10-apps dba 18
 

En vedette

Katas, Contests and Coding Dojos
Katas, Contests and Coding DojosKatas, Contests and Coding Dojos
Katas, Contests and Coding DojosKerry Buckley
 
Getting Started With Php Frameworks @BCP5
Getting Started With Php Frameworks @BCP5Getting Started With Php Frameworks @BCP5
Getting Started With Php Frameworks @BCP5Amit Kumar Singh
 
Joomla Day India 2009 Business Logic With The Mvc
Joomla Day India 2009   Business Logic With The MvcJoomla Day India 2009   Business Logic With The Mvc
Joomla Day India 2009 Business Logic With The MvcAmit Kumar Singh
 
Inovação Aberta - Open Innovation
Inovação Aberta - Open InnovationInovação Aberta - Open Innovation
Inovação Aberta - Open Innovationgcm
 

En vedette (6)

JQuery: Introduction
JQuery: IntroductionJQuery: Introduction
JQuery: Introduction
 
Katas, Contests and Coding Dojos
Katas, Contests and Coding DojosKatas, Contests and Coding Dojos
Katas, Contests and Coding Dojos
 
DRUPAL Menu System
DRUPAL Menu SystemDRUPAL Menu System
DRUPAL Menu System
 
Getting Started With Php Frameworks @BCP5
Getting Started With Php Frameworks @BCP5Getting Started With Php Frameworks @BCP5
Getting Started With Php Frameworks @BCP5
 
Joomla Day India 2009 Business Logic With The Mvc
Joomla Day India 2009   Business Logic With The MvcJoomla Day India 2009   Business Logic With The Mvc
Joomla Day India 2009 Business Logic With The Mvc
 
Inovação Aberta - Open Innovation
Inovação Aberta - Open InnovationInovação Aberta - Open Innovation
Inovação Aberta - Open Innovation
 

Similaire à Drupal Modules

Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7 Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7 Dhinakaran Mani
 
Intro to drupal module internals asheville
Intro to drupal module internals ashevilleIntro to drupal module internals asheville
Intro to drupal module internals ashevillecgmonroe
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practicesSynapseindiappsdevelopment
 
7 Theming in Drupal
7 Theming in Drupal7 Theming in Drupal
7 Theming in DrupalWingston
 
dylibencapsulation
dylibencapsulationdylibencapsulation
dylibencapsulationCole Herzog
 
Drupal module development
Drupal module developmentDrupal module development
Drupal module developmentRachit Gupta
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesGerald Villorente
 
Architecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampArchitecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampDipen Chaudhary
 
Drupal 7 Features - Introduction - Basics
Drupal 7 Features - Introduction - BasicsDrupal 7 Features - Introduction - Basics
Drupal 7 Features - Introduction - BasicsDhinakaran Mani
 
Drupal 8 meets to symphony
Drupal 8 meets to symphonyDrupal 8 meets to symphony
Drupal 8 meets to symphonyBrahampal Singh
 
Drupal 6 Overview
Drupal 6 OverviewDrupal 6 Overview
Drupal 6 OverviewRyan Cross
 
13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overview
13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overview13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overview
13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overviewDrupalMumbai
 

Similaire à Drupal Modules (20)

Dn D Custom 1
Dn D Custom 1Dn D Custom 1
Dn D Custom 1
 
Dn D Custom 1
Dn D Custom 1Dn D Custom 1
Dn D Custom 1
 
Drupal
DrupalDrupal
Drupal
 
Drupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating ModulesDrupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating Modules
 
Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7 Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7
 
Intro to drupal module internals asheville
Intro to drupal module internals ashevilleIntro to drupal module internals asheville
Intro to drupal module internals asheville
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practices
 
7 Theming in Drupal
7 Theming in Drupal7 Theming in Drupal
7 Theming in Drupal
 
dylibencapsulation
dylibencapsulationdylibencapsulation
dylibencapsulation
 
Drupal module development
Drupal module developmentDrupal module development
Drupal module development
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 
Architecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampArchitecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal Camp
 
Drupal 7 Features - Introduction - Basics
Drupal 7 Features - Introduction - BasicsDrupal 7 Features - Introduction - Basics
Drupal 7 Features - Introduction - Basics
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
 
Drupal 8 meets to symphony
Drupal 8 meets to symphonyDrupal 8 meets to symphony
Drupal 8 meets to symphony
 
Dashboard
DashboardDashboard
Dashboard
 
Drupal 6 Overview
Drupal 6 OverviewDrupal 6 Overview
Drupal 6 Overview
 
Drupal Theming
Drupal Theming Drupal Theming
Drupal Theming
 
13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overview
13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overview13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overview
13th Sep - Drupal Global Training Day by TCS - Drupal core advanced overview
 
Drupal theme development
Drupal theme developmentDrupal theme development
Drupal theme development
 

Plus de Amit Kumar Singh

Improving Core Web Vitals for WordPress
Improving Core Web Vitals for WordPressImproving Core Web Vitals for WordPress
Improving Core Web Vitals for WordPressAmit Kumar Singh
 
Getting started with WordPress Development
Getting started with WordPress DevelopmentGetting started with WordPress Development
Getting started with WordPress DevelopmentAmit Kumar Singh
 
Alternate Development Techniques on WordPress
Alternate Development Techniques on WordPressAlternate Development Techniques on WordPress
Alternate Development Techniques on WordPressAmit Kumar Singh
 
Building Minimal Viable Product (MVP) with WordPress
Building Minimal Viable Product (MVP) with WordPressBuilding Minimal Viable Product (MVP) with WordPress
Building Minimal Viable Product (MVP) with WordPressAmit Kumar Singh
 
Rapid Prototyping With WordPress
Rapid Prototyping With WordPressRapid Prototyping With WordPress
Rapid Prototyping With WordPressAmit Kumar Singh
 
Stop Coding; Start Assembling Your Websites
Stop Coding; Start Assembling Your WebsitesStop Coding; Start Assembling Your Websites
Stop Coding; Start Assembling Your WebsitesAmit Kumar Singh
 
WordPress as Rapid Prototyping Tool
WordPress as Rapid Prototyping ToolWordPress as Rapid Prototyping Tool
WordPress as Rapid Prototyping ToolAmit Kumar Singh
 
Leveraging your business with WordPress
Leveraging your business with WordPressLeveraging your business with WordPress
Leveraging your business with WordPressAmit Kumar Singh
 
Custom Post Type and Taxonomies in WordPress 3.x
Custom Post Type and Taxonomies in WordPress 3.xCustom Post Type and Taxonomies in WordPress 3.x
Custom Post Type and Taxonomies in WordPress 3.xAmit Kumar Singh
 
WPoid : You Blog, We Take Care Of The Rest
WPoid : You Blog, We Take Care Of The RestWPoid : You Blog, We Take Care Of The Rest
WPoid : You Blog, We Take Care Of The RestAmit Kumar Singh
 
Joomla Request To Response
Joomla Request To ResponseJoomla Request To Response
Joomla Request To ResponseAmit Kumar Singh
 
Introduction to web services and how to in php
Introduction to web services and how to in phpIntroduction to web services and how to in php
Introduction to web services and how to in phpAmit Kumar Singh
 
Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Amit Kumar Singh
 

Plus de Amit Kumar Singh (20)

Improving Core Web Vitals for WordPress
Improving Core Web Vitals for WordPressImproving Core Web Vitals for WordPress
Improving Core Web Vitals for WordPress
 
Getting started with WordPress Development
Getting started with WordPress DevelopmentGetting started with WordPress Development
Getting started with WordPress Development
 
Alternate Development Techniques on WordPress
Alternate Development Techniques on WordPressAlternate Development Techniques on WordPress
Alternate Development Techniques on WordPress
 
Building Minimal Viable Product (MVP) with WordPress
Building Minimal Viable Product (MVP) with WordPressBuilding Minimal Viable Product (MVP) with WordPress
Building Minimal Viable Product (MVP) with WordPress
 
Rapid Prototyping With WordPress
Rapid Prototyping With WordPressRapid Prototyping With WordPress
Rapid Prototyping With WordPress
 
Stop Coding; Start Assembling Your Websites
Stop Coding; Start Assembling Your WebsitesStop Coding; Start Assembling Your Websites
Stop Coding; Start Assembling Your Websites
 
WordPress as Rapid Prototyping Tool
WordPress as Rapid Prototyping ToolWordPress as Rapid Prototyping Tool
WordPress as Rapid Prototyping Tool
 
WordPress Use Cases
WordPress Use CasesWordPress Use Cases
WordPress Use Cases
 
Leveraging your business with WordPress
Leveraging your business with WordPressLeveraging your business with WordPress
Leveraging your business with WordPress
 
Maharashtra at a glance
Maharashtra at a glanceMaharashtra at a glance
Maharashtra at a glance
 
Custom Post Type and Taxonomies in WordPress 3.x
Custom Post Type and Taxonomies in WordPress 3.xCustom Post Type and Taxonomies in WordPress 3.x
Custom Post Type and Taxonomies in WordPress 3.x
 
WPoid : You Blog, We Take Care Of The Rest
WPoid : You Blog, We Take Care Of The RestWPoid : You Blog, We Take Care Of The Rest
WPoid : You Blog, We Take Care Of The Rest
 
Joomla Request To Response
Joomla Request To ResponseJoomla Request To Response
Joomla Request To Response
 
Introduction to web services and how to in php
Introduction to web services and how to in phpIntroduction to web services and how to in php
Introduction to web services and how to in php
 
Php Security
Php SecurityPhp Security
Php Security
 
Open Social Phpcamp
Open Social PhpcampOpen Social Phpcamp
Open Social Phpcamp
 
Overview Of Drupal
Overview Of DrupalOverview Of Drupal
Overview Of Drupal
 
PHP tips by a MYSQL DBA
PHP tips by a MYSQL DBAPHP tips by a MYSQL DBA
PHP tips by a MYSQL DBA
 
Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)
 
Tables And SQL basics
Tables And SQL basicsTables And SQL basics
Tables And SQL basics
 

Dernier

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Dernier (20)

unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Drupal Modules

  • 1. Well Come to all of you in Drupal (CMS) Session . Developed By. Kunal Guide by: Amit What is Drupal? Drupal is used to build web sites. It’s a highly modular, open source web content management framework Last Updated: October 17 2007
  • 2. Generally there are four types of files in drupal we used. These files extension are 1) .CSS 2) .Info 3) .Install 4) .Module Shortly introduction about above files. 1) .Css :-> Use of css files for change the layout of that perticular module. 2) .Info :-> This file is like the .ini file in windows. the concept of a .info file has been introduced to give Drupal a little more information about your module. 3) .Module :-> Total Functionality about your module. Last Updated: October 17 2007
  • 3. MODULES: Drupal is a truly modular framework. Functionality is included in modules, which can be enabled or disabled (some required modules cannot be disabled). Features are added to a Drupal web site by enabling existing modules, installing modules written by members of the Drupal community,or writing new modules. Drupal makes use of the inversion of control design pattern, in which modular functionality is called by the framework at the appropriate time. These opportunities for modules to do their thing are called hooks. Hooks: Hooks can be thought of as internal Drupal events. They are also called callbacks, though because they are constructed by function naming conventions and not by registering with a listener, they are not truly being called back. Hooks allow modules to “hook into” what is happening in the rest of Drupal.Suppose a user logs into your Drupal web site. At the time the user logs in, Drupal fires the user hook. That means that any function named according to the convention module name plus hook name will be called. Blocks: A block is information that can be enabled or disabled in a specific location on your web site’s template. For example, a block might display the number of current active users on your site.You might have a block containing the most active users, or a list of upcoming events. Blocks are typically placed in a template’s sidebar, header, or footer. Blocks can be set to display on nodes of a certain type, only on the front page, or according to other criteria. Last Updated: October 17 2007
  • 4. .Info :-> This file is like the .ini file in windows. the concept of a .info file has been introduced to give Drupal a little more information about your module.This file is used primarily by the modules administration system for display purposes as well as providing criteria to control activation and deactivation. This file is required for Drupal 5 to recognize the presence of a module.The .info file should have the same name as the .module file and reside in the same directory. For example, if your module is named example.module then your .info file should be named example.info.info files may contain comments. The comment character is the semi-colon and denotes a comment until the end of the line. A comment may begin at any point on the line, thus it is especially important you quote any string that contains a comment. It is typical to place the CVS Id at the top of a .info file using a comment: The .info file can contain the following fields: A) name (Required): The displayed name of your module. It should follow the Drupal 5 capitalization standard: only the first letter of the first word is capitalized Ex. name = &quot;Forum&quot; B) description (Required) : A short, preferably one line description that will tell the administrator what this module does on the module administration page. Remember, overly long descriptions can make this page difficult to work with, so please try to be concise. This field is limited to 255 characters.Ex. description = &quot;Enables threaded discussions about general topics.“ If your .info file's description (or other field) contains characters other than alphanumeric values then you must quote the string. If you need to use &quot; in the string then you need to use the &quot; value to display the &quot; character.For example, this will display correctly: description = &quot;This is my &quot;crazy@email.com&quot; email address“ This is wrong and cause Drupal to display an error when going to the modules menu:description = This is my &quot;crazy@email.com&quot; address <- DO NOT DO THIS Last Updated: October 17 2007 Next Page Next Page
  • 5. C) dependencies (Optional): A space separated list of other modules that your module requires. If these modules are not present, your module can not be enabled. If these modules are present but not enabled, the administrator will be prompted with a list of additional modules to enable and may choose to enable the required modules as well, or cancel at that point. Ex. dependencies = taxonomy comment D) package (Optional): If your module comes with other modules or is meant to be used exclusively with other modules, enter the name of the package here. If left blank, the module will be listed as 'Other'. Ex. package = Views Suggested examples of appropriate items for the package field: 1) Chat 2) Location 3) View 4) Event 5) Video E) version (Optional): Display the version of your modules. Ex. version = 1.1 F) project (packaging use only): Module maintainers should not use this at all. The packaging script on drupal.org will automatically place a string here to identify what project the module came from. This is primarily for the Update status module, so that Drupal installations can monitor versions of installed packages and notify administrators when new versions are available. Last Updated: October 17 2007
  • 6. 3) .Install :-> .install files to do module setup work. A .install file is run the first time a module is enabled, and is used to do setup required by the module. The most common task is creating database tables and fields . .install files are also used to perform updates when a new version of a module needs it. There are three functions in .install files. 1) _install() 2) _Update_x() 3) _Uninstall() Use of _install() function is to install the or create the tables in your database. There are two types of labraries/Packages are used by Drupal. These are MySqli & PgSql Note about already installed modules If the module you are writing the .install file for is already installed then the install/update(s) will not trigger even if you disable/enable it. You need to disable the module and remove its record manually form the system table or include a hook_uninstall function. Last Updated: October 17 2007 Next Page Next Page
  • 7. Syntax For _Install(): function xyz_install() { switch ($GLOBALS['db_type']) { case 'mysql': case 'mysqli': db_query(&quot;CREATE TABLE {xyz_data} ( vid int unsigned NOT NULL default '0', field_name varchar(32) NOT NULL default '')); break; case 'pgsql': db_query(&quot;CREATE TABLE {xyz_data} ( vid serial CHECK (vid >= 0), field_name varchar(32) NOT NULL default '')); db_query(&quot;CREATE INDEX {xyz_data}_field_name_idx ON {xyz_data} (field_name)&quot;); break; } } Last Updated: October 17 2007 Next Page Next Page
  • 8. use of _update_x(): .install files can also include update instructions, which are used through update.php like regular Drupal updates. Each update is placed in a modulename_update_x() function (where x is an incrementing integer). Updates should always increment by 1. Syntax For _update_x(): function example_update_1() { $items = array(); $items[] = update_sql(&quot;ALTER TABLE {example} ADD new_column text&quot;); $items[] = update_sql(&quot;ALTER TABLE {example} DROP old_column&quot;); return $items; } Last Updated: October 17 2007 Next Page Next Page
  • 9. The _uninstall function is also available in a .install file and gets fired when a module is uninstalled. This function generally includes dropping tables and deleting variables specific to that module. Syntax _uninstall(): function search_uninstall() { db_query('DROP TABLE {xyz_data}'); db_query('DROP TABLE {xyz_index}'); db_query('DROP TABLE {search_total}'); variable_del('minimum_word_size'); variable_del('overlap_cjk'); } Last Updated: October 17 2007 Next Page Next Page
  • 10. In Your .Module files you use the hook’s as a function name. suppose _help is the name of your hook then the name of function should be xyz_help() And the xyz is name of your module. There are certain rules while writing the modules. Last Updated: October 17 2007
  • 11.
  • 12.

Notes de l'éditeur

  1. Use this template to create Intranet web pages for your workgroup or project. You can modify the sample content to add your own information, and you can even change the structure of the web site by adding and removing slides. The navigation controls are on the slide master. To change them, on the View menu, point to Master , then choose Slide Master . To add or remove hyperlinks on text or objects, or to change existing hyperlinks, select the text or object, then choose Hyperlink from the Insert menu. When you’re finished customizing, delete these notes to save space in your final HTML files. For more information, ask the Answer Wizard about: The Slide Master Hyperlinks