background preloader

Preprocess (module[3] drupal[2])

Facebook Twitter

LESS CSS Preprocessor. This is a preprocessor for LESS files. Built using the lessphp library by Leaf Corcoran. This module will automatically process any LESS files that are added using drupal_add_css or added through your theme's .info file. Add your files just like any other css file, just with .less as the extension, and they will be automatically processed. 7.x-3.0 New Features There are several new features: Live style reloadVariables editable in UI per themeCustom LESS functionsCorrect relative path @import'sDemo module included The included less_demo module should provide API demonstration for new features. Installation Download & Install Libraries API.Download lessphp and unpack it so that 'lessc.inc.php' is located at 'sites/all/libraries/lessphp/lessc.inc.php'.Download and install (this) module. Compatibility: Fully compatible with CSS aggregation: Drupal 6 "Optimize CSS files" setting under "Administer→Site configuration→Performance" (admin/settings/performance).

LESS Development: Syntax File placement Apido. CSS Flip. CSS Flip is a powerful tool for Drupal theme developers who need to create multilingual themes easily and quickly. It aims to act like a backend engine, where it automatically parses stylesheets from themes and modules, flips their styles and injects them into your pages. You do NOT need to create RTL stylesheets. However you still have the option to use the regular Drupal way, and utilize the tools provided in this module to flip your stylesheets easily and quickly. The module is designed to fit Drupal needs.

It takes care of flipping and creating CSS files in a proper way that Drupal themes understand. Supress duplicate styles in flipped CSS filesFix styles for absolute positions to fit with Drupal themesRely on native CSS Parser for flipping. Drupal - How do I use theme preprocessor functions for my own templates. 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.

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: Template_preprocess.