1/30/11 Hacking your way through the Drupal API, a themers intro Baris Wanschers (BarisW)

Slides:



Advertisements
Similar presentations
MRSEC Webmasters Meeting Feb 7, Agenda Introductions Webmasters' mailing list/user group (creating space for mrsec webmasters to exchange knowledge.
Advertisements

CAR Training Module PRODUCT REGISTRATION and MANAGEMENT Module 5-Register the Web URL for a CAR Document Type (Run as a PowerPoint show)
The easy way to integrated communication.  Desknow will allow a user to share information with any other user on the system even if that user is in another.
Getting Started. Edline Web Site Requirements Provide Students and Parents With: 1.A Brief Course Description 2.Your Address 3.Course Syllabus 4.Major.
“Drupal is written in PHP, which is uttterly offensive to people.” H o r r i b l e T r u t h 1.
Contensis Training How do I Create a new Web Page.
Introduction to Module Development Yi Zhang & Nikki Massaro Kauffman.
Background Current Status Future Plans. Agenda Background First Steps Current Status Future Plans Joomla Basics Questions 2.
Top 10 Blackboard Tips for Students. 1. Search Blackboard Blackboard has a search tool, which allows you to search through all the course web sites and.
Dynamic Web Pages. Web Programming  All our web pages so far have been static pages. 1. We create a web page 2. We upload it to the web server 3. People.
The Online Activities Module OAM Describing the F-7 & F-7A.
Pre-Authorization for Faculty Travel Request Form.
Blackboard student guidepage 1 of 21 Blackboard Basics – finding your way  this guide explains how to find your way around a Blackboard course.  click.
1 of 4 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Google Confidential and Proprietary 1 Intro to Docs Google Apps Apps.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
The Dr ü G Book: An Intro to Drupal The Dr ü G Book: An Intro to Drupal (Dr ü G: Drupal User ’ s Group - users, not developers) This is an introduction.
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
The 12 screens to follow contain a number of Tool descriptions, some instructions on their use, and in some cases a Task or two. If you dedicate one hour.
Label production Solution with Label Gallery programs Label Gallery is used for general label design and print GalleryData is used to create small database.
Drupal 7 as an enterprise web application framework Why as a developer you should use Drupal to build web applications? Klaus Harris DrupalCon Munich 2012.
5-topic Template by Eric Curts - twitter.com/ericcurtstwitter.com/ericcurts -
The Drupal 6 menu system: architecture, do, don't and tricks (part 1) Peter Wolanin August 27, 2008 Drupalcon, Szeged.
TOP 20 MISTAKES YOU WILL MAKE IN YOUR 1ST DRUPAL PROJECT IZTOK SMOLIČ, ZAGREB.
SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal: Configuration and Customization Week 4: Installation, Module Development January 25,
Drupal Training Syllabus Chaitanya Lakshmi
How to extend and configure Drupal without user interaction or database dump By Damien Snoeck for Switzerland Romandy Drupal Group January 27, 2010 Work.
(PubMed) MY NCBI (Advanced Course: Module 2). Table of Contents  How to register and sign into MY NCBI  Setting up filters in MY NCBI  Saving searches.
Feeds Module for Drupal 7 Use Cases, Overview, and Walktroughs.
Nipissing’s ROMEO e-System Internal Research Funding (IRF) Internal Research Grant Application Form (IRG)
Adobe Certified Associate Objectives 6 Evaluating and Maintaining a site.
Registration and Log-in Flow Benjamin Melançon agaric.com & dgd7.org.
Translating Drupal Websites Sean Burlington Quick run through  Translation generally  Lessons learned  Drupal specifics  String.
Training the Trainer Instructors: Caitlin Frederick & Darrell Wiggins Let Smart ISD™ Make Your Job Easier! Please go to demo.smartisd.com Log in-
Drupal Commerce Better than Uber Andrew Root: druroot.
WHAT IS DRUPAL? by Peter K. Johnson - Originally presented at Minnebar - April 2012 What you need.
Static HTML to Drupal Theme By Ivan Zugec. Static HTML to Drupal Theme. Setting up a theme. Overriding tpl files. Using the devel module. Q and A.
What you don’t know you don’t know about Drupal 6 Dan Harris daneesia on drupal.org.
Friend Connect Integration. WordPress Open source blog engine PHP / MySQL based Completely customizable Plugin friendly.
Forensic Drupal Debugging Dan Harris daneesia on drupal.org.
Introduction to Module Development John Fiala and Ezra Barnett Gildesgame.
(PubMed) MY NCBI (Advanced Course: Module 2). Table of Contents  How to register and sign into MY NCBI  Setting up filters in MY NCBI  Saving searches.
How does Drupal Work? Information Systems 337 Prof. Harry Plantinga.
Go to community.epicomm.org and sign in by clicking the button in the upper right corner. Logging into the Connected Community.
M Dixon 1 Tech HTML. M Dixon 2 Admin Attendance Register: –log in to your profile.
Procurement Query Login Using Mail User & Password.
Workflow Demo: Upload, Review and Approve. Cpay : Users & Functionalities Customer AdministratorCustomer AuthorizerUploaderReviewerApproverInterceptor.
MGS 351 Introduction to Management Information Systems RECITATION 12.
Getting Started. Package Overview (GradeQuick)‏ Web-based grade book –Access Anywhere –Always Current Paper grade book “look and feel” Flexible grading.
Word Merge Publish. Setup on Tools-Options menu of Search Button on the Search Hit List Creates an Access database of records on the Hit List Use Mail.
Portaportal Portaportal is a web based bookmarking utility that lets you store links to your favorite websites online. Now your bookmarks are no longer.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
Drupal Content Management System Mallikarjuna Pinjala CIS 764, Nov
Using Middle Search® Plus For Junior Academic Bowl Competitions.
Login Page Ministry link message block The Ministry app will open to a login screen with a username and password edit box. A login and cancel button for.
Working with ASP.NET Controls What is ASP.NET Using server controls in your pages Allowing users to create their own accounts Creating a login page Letting.
MGS 351 Introduction to Management Information Systems Recitation # 12.
How to use Drupal Awdhesh Kumar (Team Leader) Presentation Topic.
Views: From the Beginning John Fiala Twitter: jcfiala Vintage Digital.
Pragmatic Drupal Development John Fiala Developer.
Introduction To Simple WordPress Plugin Development
An Xray Look at Drupal 7 (OK, a look at permission machine names and some hooks.) Get Xray: gitorious.org/xray/xray gitorious.org/xray/xray/archive-tarball/master.
Global Drupal Training Day
Portal Workshop make it simple
Learning about Taxes with Intuit ProFile
Technology Support Center Office 365 Outlook
Learning about Taxes with Intuit ProFile
Guide to Editors (ED) Journal of Mountain Science (JMS)
RMA User Guide.
Presentation transcript:

1/30/11 Hacking your way through the Drupal API, a themers intro Baris Wanschers (BarisW)

How to chop an onion?

Baris Wanschers Drupal Specialist at Sogeti Board member of the Dutch Drupal foundation Maintainer of some small modules (Google Fonts, Termcase, Menu Force, Translate This button, etc) Wrote some patches for Drupal 7 Core Build

Agenda The joy of a contrib modules They come with limits More modules to fix this? Or can we do this ourselves? Some usecases and example code (don’t panic, it’s just PHP)

My first little module

What do you need? A folder to store the files in (mymodule) An info file (mymodule.info) to describe the module A module file (mymodule.module) with the actual code

mymodule.info name = My module description = "The description of my module" core = 7.x ; Module dependencies dependencies[] = taxonomy

The hook system

hook_what? Drupal modules are build around hooks. Hooks are functions that Drupal tries to access Replace hook_ with yourmodule_ Example: mymodule_menu is a call to hook_menu in mymodule Check the API on hook_. You can use these!

Example: hook_init Perform setup tasks This hook is run at the beginning of the page request

Example: hook_init Perform setup tasks This hook is run at the beginning of the page request

The power is yours If you know just these hooks hook_menu_alter to change navigation items hook_form_alter to edit forms Also interesting hook_node_* (hook_node_view, hook_node_load, etc) hook_user_* (hook_user_view, etc)

Menu system function devdays_menu() { $items['hello-world'] = array( 'title' => 'Hello world', 'page callback' => 'devdays_hello_world', 'access arguments' => array('access content'), 'type' => MENU_NORMAL_ITEM, ); return $items; } DEMO

Form system $form['title'] = array( '#type' => 'textfield', '#title' => 'My title', '#required' => TRUE, ); $form['description'] = array( '#type' => 'textarea', '#title' => 'Description', ); DEMO

Improve the user form User register / log in

Let’s begin! Useful links Devel module: Drupal API: Drush: DEMO

New revision Make the log message required

Summary What did you learn? Basic insight in the hook_system Few lines of code instead of huge modules and hours of searching hook_menu_alter to change menu items (also to override a function) hook_form_alter to change forms (and change classes/id’s)

Summary What did you learn?

Questions? Drupal.org / IRC: BarisW Web: Mail: