background preloader

Drupal

Facebook Twitter

Ctools

Inspiration. Quiz affiliated Modules. All questions in a single page. Djdevin's sandbox: Quiz Single-page Support. Migration. Setting up variables for use in a template (preprocess and process functions) The main role of the preprocessor is to set up variables to be placed within the template (.tpl.php) files.

Setting up variables for use in a template (preprocess and process functions)

From Drupal 7 they apply to templates and functions, whereas in Drupal 6 preprocess functions only apply to theming hooks implemented as templates; plain theme functions do not interact with preprocessors. Notes: Preprocessors are also used for providing template suggestions.In versions 5 and below, the function _phptemplate_variables served the same purpose. It has been deprecated in 6.Prior to Drupal 6.7, for your theme to have its preprocessors recognized, the template associated with the hook had to exist inside the theme. When a default template exists, copy it to your theme and clear the registry (or you should really be upgrading to a later version of Drupal anyway for security reasons, at which point you don't have to worry about this).

There can be numerous preprocessors for each theming hook. Here are the expected preprocessors. A few notes:

Forms

Mobile. Groups. Tutorials. Development Environment for Drupal Sites. As you may know, GeologyRocks uses drupal, a rather excellent CMS.

Development Environment for Drupal Sites

This brings about a few headaches when trying to develop your own code for it as the content (i.e. the stuff you need to test out your new code) is in the database, not as a series of HTML files as for a static websites. To help me develop new features for GeologyRocks, I've set up a development environment for drupal-based sites. This is how I did it... Method The aim is to create three versions of the website: A mirrorA development version (sandbox)A stable checkout version which contains files, etc ready to upload to live server Each site needs to function the same as the live server (i.e. minimal database and file changes).

The general strategy is: create working dir and stable dircreate website, ready for live serveronce ready, place code on live serverinitiate mirroring proceduredevelop on working dir, every so often updating the database from the mirror. Set-up Directory structure: Mirroring: Updating working version . #! Design A Website Within Hours With Drupal (Free Software)

Modules

Themes. Template. Views. Tips. Drupal 6.x and the HTTP request status fails message. As we were developing this site, one day all of a sudden, the news aggregator stopped working and our status page started to report that the site could no longer check for updates.

Drupal 6.x and the HTTP request status fails message

It was the dreaded "HTTP request status fails" message that many Drupal users have been struggling with lately ( and After some digging around in the code, I realized a couple of things. One had to do with the site hosting service I'm using at the moment (godaddy.com free hosting). The other was how Drupal 6 handles outgoing HTTP requests. It works like this: Drupal is happy enough sending out requests to other services, until there is any type of failure in the request. In the code, it has to do with the error recovery in drupal_http_request in common.inc for version 6. The code in question is: if (! Which tries to recover in the event that a request has failed previously. Function system_check_http_request() { // Check whether we can do any request at all. $result->code = $code; return $result; }