Drupal development

From Things and Stuff Wiki
Jump to navigation Jump to search


needs refactoring to work with theming

See Building Distros Theming / Aegir

Architecture

  • Drupal dev docs - "Newcomers to Drupal development should read the conceptual information provided in the 'Components of Drupal' section, and then proceed to examine one of the heavily-documented example modules below. The examples are fully-functioning Drupal modules, so you can download them from the contributions repository and alter them as you experiment."

Multisite

Provision

See Building, Aegir

  • Dcycle defines standards for deployment, testing and continuous integration, for a dev-stage-production workflow.

Drupal.org

see project page right sidebar links for git, patches pending, etc.

Utilities


CLI

Debugging

dpm()

Admin

Content

Module Admin

Performance

Boost

  • Boost provides static page caching for Drupal enabling a very significant performance and scalability boost for sites that receive mostly anonymous traffic. For shared hosting this is your best option in terms of improving performance. On dedicated servers, you may want to consider Varnish instead. Apache is fully supported, with Nginx, Lighttpd and IIS 7 semi-supported. Boost will cache & gzip compress html, xml, ajax, css, & javascript. Boosts cache expiration logic is very advanced; it's fairly simple to have different cache lifetimes for different parts of your site. The built in crawler makes sure expired content is quickly regenerated for fast page loading.

CloudFlair

Other

  • Cache Control is a module for integrating your site with the Varnish HTTP accelarator (and other external HTTP-caches) in a fashion that not only allows for caching pageloads for anonymous users but also for authenticated users.

Coding

Basics

$variable_name

Modules

Patches

patch -p1 < path/file.patch

or

git apply path/file.patch

Hooks

"Drupal's module system is based on the concept of "hooks". A hook is a PHP function that is named foo_bar(), where "foo" is the name of the module (whose filename is thus foo.module) and "bar" is the name of the hook. Each hook has a defined set of parameters and a specified result type.

"To extend Drupal, a module need simply implement a hook. When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and calls that hook in all enabled modules that implement it."

Menu system (path)

Content

Entities

An entity can be a kind of content stack. An entity base table is tied to fields using bundles. Entity types include node, comment, taxonomy term, user profile, organic group, etc. Entity types can allow bundling or not (creating types of node vs. users, though see the Profile 2 module). Fields are used to store and display various data types, and can be reused across bundles and entities.

(that was about right the last time I dived in)

hook_entity_info - "Inform the base system and the Field API about one or more entity types."

Taxonomy

Ctools

Chaos tool suite (ctools) suite is primarily a set of APIs and tools to improve the developer experience. It also contains a module called the Page Manager whose job is to manage pages. In particular it manages panel pages, but as it grows it will be able to manage far more than just Panels.

For the moment, it includes the following tools:

  • Plugins -- tools to make it easy for modules to let other modules implement plugins from .inc files.
  • Exportables -- tools to make it easier for modules to have objects that live in database or live in code, such as 'default views'.
  • AJAX responder -- tools to make it easier for the server to handle AJAX requests and tell the client what to do with them.
  • Form tools -- tools to make it easier for forms to deal with AJAX.
  • Object caching -- tool to make it easier to edit an object across multiple page requests and cache the editing work.
  • Contexts -- the notion of wrapping objects in a unified wrapper and providing an API to create and accept these contexts as input.
  • Modal dialog -- tool to make it simple to put a form in a modal dialog.
  • Dependent -- a simple form widget to make form items appear and disappear based upon the selections in another item.
  • Content -- pluggable content types used as panes in Panels and other modules like Dashboard.
  • Form wizard -- an API to make multi-step forms much easier.
  • CSS tools -- tools to cache and sanitize CSS easily to make user-input CSS safe.
  • Ctools Plugin Stub is a Drush plugin that can help you generate code stub files for ctools plugins. I wrote this plugin after having consistently messed up names of hook implementations in plugins over a long period. Plugin Stub does not write actual code that *does* stuff for you, but it sets you up so that all you have to do to get started is to fill in the capitalized parts of the generated file and start writing code that *does* stuff.

Menus

JavaScript

Video

Adding a JS file

In theme .info;

scripts[] = scriptfile.js

In template.php;

drupal_add_js()
  first paramater path
  second paramater (goes through as 'type: ' array item, defaults to file)
    file, setting, inline, external
    default: preprocess: true, everypage: true, 
    weight:
$element['#attached']['js']

Drupal JS API and Behaviours

Drupal has an API for passing information between PHP and JS. Drupal.js sets up Drupal namespace.

Render Array

PHP sent by JSON to change content.

jQuery

The .ready() function also has the ability to alias the jQuery object:

jQuery(document).ready(function($) {
  // Code that uses jQuery's $ can follow here.
});

AJAX

JSON


wip; still merging in from Modules and rearranging

General

Core non-core

Admin

Workflow

Editing of submitted unpublished nodes, updating coordinator contact info, etc.

Antispam

Logging

E-mail

Layout

Spaces

Blocks

Views

Views is used to display bits of content in various fashions.

  • How to display content nodes using Views 3: *to source again*

API

Modules

Menus

Aggregation

Context

Display Suite

  • Display Suite allows you to take full control over how your content is displayed using a drag and drop interface. Arrange your nodes, views, comments, user data etc. the way you want without having to work your way through dozens of template files. A predefined list of layouts (D7 only) is available for even more drag and drop fun! By defining custom view modes (build modes in D6), you can define how one piece of content should be displayed in different places such as teaser lists, search results, the full node, views etc.

Docs

Articles

Videos

Panels

Nodequeue

Manual list of content items, can be used in Views.

Path

Title

Menus

  • https://drupal.org/project/floating_block - keep html blocks, selected using jquery selectors in a fixed position on the page as you scroll. It works in a similar way the table header fixer in Drupal Core.
  • Custom Active Menu Item - provides an easy way to indicate which menu item is active adding the active CSS class depending the path that the users are seeing.

Breadcrumbs

or check your theme page.tpl.php

Links

Content

to sort;

Entities

  • http://drupal.org/project/entity - "extends the entity API of Drupal core in order to provide a unified way to deal with entities and their properties. Additionally, it provides an entity CRUD controller, which helps simplifying the creation of new entity types."
  • http://drupal.org/project/file_entity - makes the file entity full fledged, allowing for fields, display formatters, and more.

Fields

Bundles

Nodes


all needs moving to contrib and more.

Forms

Aggregation

GUI

Typography


Comments

Javascript

Adverts

  • http://drupal.org/project/openx - Show ads from a OpenX (formerly OpenAds) server. OpenX is a open source online program that will allow you to catalog and display advertisers, just like Google, Yahoo or Microsoft.

Internationalisation


Media

  • http://drupal.org/project/media - provides an extensible framework for managing files and multimedia assets, regardless of whether they are hosted on your own site or a 3rd party site - it is commonly referred to as a 'file browser to the internet'. Media is a drop-in replacement for the Drupal core upload field with a unified User Interface where editors and administrators can upload, manage, and reuse files and multimedia assets. Any files uploaded before Media was enabled will automatically take advantage of for many of the features it comes with.
  • Displaying Media - The File Entity and Media modules work together to provide a unified method for storing, managing, and displaying Media in Drupal. They allow a user to create file fields that can be configured to store and display many different types of media, including images, video, and audio, sometimes created by Media provider modules (e.g., Media: YouTube, Media: Soundcloud, or OEmbed). In order to display these different types of media, file fields use formatters, often added by the provider module, that need to be configured when setting up your site.

Embedded Media Field

  • http://drupal.org/project/emfield - create fields for content types that can be used to display video, image, and audio files from various third party providers. When entering the content, the user will simply paste the URL or embed code from the third party, and the module will automatically determine which content provider is being used. When displaying the content, the proper embedding format will be used.

Imagecache / filters

Lightbox

Gallery

  • http://drupal.org/project/node_gallery - create multimedia galleries where both the galleries and the gallery items are nodes. (as opposed to gallery items being file fields, like Media Gallery)
  • Galerie provides (hopefuly) easy to use and clean galleries based on an API/submodules model. galerie itself provides a "galerie" node type and manages the display of galleries (classic thumbnails and large images view, and slideshow mode) while submodules retrieve content from different sources: local files, Flickr or Tumblr for now.

other

  • File Lock - gives the possibility to "lock" files. Locking files means adding an extra file_usage entry, because Drupal will delete files which aren't used anymore. But by now there is no possibility to keep "unused" files.
  • http://drupal.org/project/plup - doesn't use plupload module. straight attaches image to end of node, no display config other than image field manage display settings. very basic media integration - broken preview and no way to hide otherwise attached images on per node basis.

untested;

Adaptive/responsive

Retina

Flickr

  • http://drupal.org/project/flickr - Access photos on Flickr's site via their API. The module provides a filter for inserting photos and photosets and allows the creation of blocks for rendering a user's recent photos and photosets. The filter format is: [flickr-photo:id=230452326,size=s] and [flickr-photoset:id=72157594262419167,size=m]
    • doesn't use image styles
  • http://drupal.org/project/media_flickr - The Media: Flickr project currently offers Flickr Photoset capabilities to the Embedded Media Field module, upon which this module is dependent. To use it, enable the Embedded Video Field module, and add a Third Party Video field to a content type.

Scald

Audio

  • http://drupal.org/project/audio - allows users with proper permissions to upload audio files into drupal. Each audio item is created as its own individual audio node. The audio module uses the getID3 library to read and write ID3 meta-tag information to and from the audio file. Pages that display the most recent audio files submitted to the site, as well as the most recent audio files uploaded by individual users are also generated. Feeds from these pages are 'podcast friendly'. The module also comes with the handy XSPF Flash player that is (by default) embedded in your site.
  • http://drupal.org/project/filefield_audio_insert - extends the functionality of the cck filefield module. It allows you to insert flash playable audio into textareas/body's of nodes. It works in conjunction with the mp3player module for audio playback.
  • http://drupal.org/project/debut_audio - A baseline embedded audio feature.Audio content type with embedded audio field supporting multiple external providers. Audio view with page listing, recent audio files block, and RSS feed. etc.
  • http://drupal.org/project/audiofield - allows you to upload audio files and automatically displays them in a selected audio player. Currently it supports 6 players and it provides API for easy addition of new players.
  • http://drupal.org/project/audioconverter - converts audio files from supported CCK fields (AudioField, AudioRecorderField) to the mp3 format using FFMPEG. Depending on the need, files can be converted on cron or whenever new audio content is submitted.
  • http://drupal.org/project/jplayer - provides a wrapper around the jPlayer JavaScript library. This library provides an HTML5-based player, that uses a Flash fallback for browsers that do not yet support it. This module provides a default presentation for the player, as well as integration with CCK file fields and a display style for Views.
  • http://drupal.org/project/mp3player - WordPress Audio Player to Drupal. Easily enable the MP3 Player on a CCK FileField. Setup multiple players each with their own settings and appearance. FileField and Views support.

Forms

Webform

Events

  • Date contains both a flexible date/time field type Date field and a Date API that other modules can use.
  • Calendar will display any Views date field in calendar formats, including CCK date fields, node created or updated dates, etc. Switch between year, month, and day views. Back and next navigation is provided for all views. Lots of the Calendar functionality comes from the Date module, so any time you update the Calendar module you should be sure you also update to the latest version of the Date module at the same time.
  • partial_date provides date and time fields that allows any individual component to be left blank, while still providing a sortable listing of the fields. Useful if you need to handle dates like "8:46 a.m Sep 11, 2001 EST", "12 noon 25 May, Early 16th Century" or "May 20000 BC" in the one field.
  • Scheduler allows nodes to be published and unpublished on specified dates.
  • Signup allows users to sign up (or register, as in register for a class) for nodes of any type. Includes options for sending a notification email to a selected email address upon a new user signup (good for notifying event coordinators, etc.) and a confirmation email to users who sign up.

Timeline

Tracker

Mapping

Spreadsheets

Books

Shortcodes

Files

Extras

Search

Notification

  • Messaging allows message sending in a channel independent way. It will provide a common API for message composition and sending while allowing plug-ins for multiple messaging methods.
  • Notifications is a complete Subscriptions/Notifications Framework aiming at extendability and scalability. It allows any number of plug-ins defining new event types or subscription types or a different user interface.
    • anon d6 only
  • Notify allows users to subscribe to periodic emails which include all new or revised content and/or comments much like the daily news letters sent by some websites. Even if this feature is not configured for normal site users, it can be a useful feature for an administrator of a site to receive notification of new content submissions and comment posts.
  • Subscriptions enables users to subscribe to be notified of changes to nodes or taxonomies, such as new comments in specific forums, or additions to some category of blog. Once enabled, all nodes will have an additional link that allows the user to change their subscriptions. Users have tab on their user screen to manage their own subscriptions. Users can also set an auto-subscribe function which notifies the user if anyone comments on posts they have made. Admins can turn this on by default.

Simplenews

Creating

WYSIWYG

See also WYSIWYG

Editing

Inplace / Inline

Embedding

External

Syndication

Semantic

External sources

Graphing

Attention

Interface

Booking

Taxonomy

  • http://drupal.org/project/content_taxonomy - D6, This module provides a CCK field type for referencing taxonomy terms. The fields are independent from vocabulary settings. For every field you can specify settings. D7,

to sort;

  • http://drupal.org/project/textmining_api - simple pluggable framework module that handle node/taxonomy terms/text fields association process for tagging/metadata services with submodules providing OpenCalais and Tagthe.net support

Token

D7: The list of the available tokens is reported in the custom PHP action page, or Pathauto config

  • Token Filter is a very simple module to make token values available as an input filter.

Users

Registration

Permissions

Spam and captchas

Login

Cookies

Passwords

Social

Profiles

use relationship in views to access fields [6]

Content: Author, (author) User: Profile

Groups

D6 OG

  • http://drupal.org/project/og_subgroups - enables a user with the proper permissions to build group hierarchies (or tree) by nesting groups under other groups. Simple or complex group hierarchies can be easily created.
  • http://drupal.org/project/og_features - allow group owners and site administrators to disable certain features/functionality within a given group (without the use of the Spaces module).
  • http://drupal.org/project/og_privacy - define the rules by which organic groups posts will be visible to non-group members. It is an API module which allows developers to create access policies which override the default behavior of OG Access and Spaces OG.
  • http://drupal.org/project/og_invite_link - OG Invite Link overrides the user invitation form that comes with OG - used to invite non-members to a given group. The key difference is that invitation emails contains a special tokenized invitation link, meant specifically for that user.
  • http://drupal.org/project/og_titles - extends group membership to include arbitrary titles with which you can add to Organic groups views. Titles are per member and arbitrary strings. Examples of titles are strings such as "Chairman", "Secretary", or "Really Cool Dude". These can be accessed via Views.
  • http://drupal.org/project/og_access_roles - extends the reach of Organic Groups' bundled Organic groups access control module by allowing node authors finer control over who can see their posts. Organic groups access control gives node authors the option of making their posts Public, meaning anyone can view the node, even anonymous users; or Private, meaning only group members can view the node. For Private posts, OG Access Roles gives node authors the ability to let users in selected roles view nodes even if those users are not in the group (or groups) where the node is posted.
  • http://drupal.org/project/og_perm - In the OG module all group admins currently have the same set of capabilities within their group. They can add/ remove members, broadcast messages, and create/remove group admins. This module requires that group admins also have a certain permission to get those capabilities.
  • http://drupal.org/project/og_massadd - Overrides the internal "add users" page of Organic Groups with a more powerful alternative. Takes a list where each row can be either: username - mail address - firstname, lastname, mail address - firstname, lastname, mail address, desired username.
    • In case 1 or if there is an mail address provided, the module first checks if it matches an existing user, and adds that user to the group.
    • In case 2-4, if there is no matching user, the user will be created (as long as the person submitting the form has permissions to do so). Newly created users will also have a content profile node created for them if enabled (has a settings page).
  • http://drupal.org/project/og_read_only - allow group administrators to set some content types as "read-only". Read only types can't be posted by simple group members, but still can be posted by group managers and users with "administer nodes" permission. Wiki group types can't be set to read only.
  • http://drupal.org/project/og_node_approval - offers content review between group members allowing them to approve or reject content. When creating or updating content simply choose the audience for the content (including multiple groups), save the node, and the module will insert group members from those respective audiences into the a node approval table.
  • http://drupal.org/project/og_audience - allows Organic Groups (OG) users to change a node's audience without having to edit the node. This module works by providing a new change audience permission, and an Audience tab and/or block on node pages that allows users to change the audience of existing content. A user can add any node to one or more of the groups he/she has subscribed to. A group manager can remove a node from his/her group(s). A node's author can remove the node from one or more of the groups he/she has subscribed to.
  • http://drupal.org/project/og_teams - create groups of users (teams) that can be subscribed to organic groups just like regular users. Teams are like user roles, you can create new teams and you can assign multiple users to any team.
  • http://drupal.org/project/og_mandatory_group - makes one group mandatory for all new users and/or requires new users to pick a group. Choose one group that all new users will be put into. You can chose either an open or a closed group. Any new user will be auto-approved as member of the group. The group manager(s) of groups that a new user joins will get an automatic e-mail notice.
  • http://drupal.org/project/og_manage - added tab to user account where administranor can select groups user belong to and make user of this groups or remove membership on one page.
  • http://drupal.org/project/ctog - Running Case Tracker and Organic Groups on the same site raises some questions - but CTOG helps solving them by utilizing some rules to tie them together in a way which makes them easier to use.
  • http://drupal.org/project/og_mailinglist - OG Mailinglist allows users to start new discussions by email and post comments on existing discussions by simply replying to emails. You get the best of both worlds: a browser-based discussion site and an email-based list.

Party

Internal network

Private messaging

Comments

Groups

Social and sharing

External integration

Facebook

Twitter

  • http://drupal.org/project/twitter_pull Twitter Pull is a small module, the only purpose of which is to allow super-easy embedding of public twitter data like: a user timeline or twitter search results by hashtag or a search term. The emphasis is on making these very specific tasks as easy and straightforward as possible. The purpose of the module is not to be an end-all solution for Twitter.

Google Plus

Sharing

External

Social service

Comms

to sort

Federation

DiSo, etc

Other

Eye candy

Countdown

External links

Aggregation

Feeds

Views owner node title - http://drupal.org/node/1257170

OpenCalais

E-commerce

See also Drupal Distros#E-commerce

Payment

  • Payment is a general payment platform which allows other modules to use any of the payment methods that plug into Payment. With Payment we only need one one Paypal, one credit card and one iDEAL module to use with every single webshop or payment form that you want (applies to any payment method that works with Payment). This shortens development time and improves support, because only one instead of three Paypal modules need to be maintained, and simplifies UX, because all payment (method) information is now located in one place.

Payment method controller modules;

Other

SEO

Analytics

Humour

Project

  • http://drupal.org/project/merci - can extend any content type into a list of unique reservable items (like studios) or buckets of interchangeable items (like DV cameras). We followed the approach used by Organic Groups, Feed API, and Scheduler and added MERCI's configuration to the Edit tab of those content types.