Themers
Drupal Performance
Given that GATE Village is built on Drupal it seems appropriate I should speak to Drupal performance in a general sense -- it's ability to perform was actually one of it's selling points for me. On of the most significant performance impact on Drupal is, of course, at the DB ... while there is a lot of logic in the code, all of the data lives in the DB and thus DB performance and DB bloat are always front and centre to a Drupal installation.
Performance
Next to security, Performance is arguably the least understood characteristic of web applications. One old colleague put it best when he talked about there being really only two states: satisfactory and not-satisfactory ... there is really no middle ground there, things are either fast enough or they are not. Unfortunately, it is also nearly impossible to know ahead of time exactly what "fast enough" is ... with "Google-speed" setting the bar for public web sites and CMS systems using authenticated almost exclusively, there is a serious performance problem waiting in the wings at all time. This was true for Livelink and no less true for Drupal.
How to insert current logged in user profile information
There are times when you'd like to display information about the current logged in user. It could be a personalized greeting, a contact form where you don't want to make the user fill out fields with information that allready exists, whatever you name it!
Anyways, all information about your registerd users is stored in your database, it's just a matter of getting the information from it and on to your website.
All databases look a bit different depending on what fields you made the user fill out when creating an account.
To find out what's available to you, create a new php-code page and paste the following code:
<?php
global $user;
$clu = user_load(array('uid' => $user->uid)); //clu: Current Logged in User (something i made up, use whatever you whish!)
print_r ($clu);
?>Preview your page, the result should look something like this:
[field_user_retailer] => Company name Inc [field_user_firstname] => Peter [field_user_surname] => Smith [field_user_telephone] => 321-123 123[field_user_titel] => manager[field_user_type] => Array ( [0] => [1] => [2] => [3] => ) [field_user_homenumber] => 321-321 321 [field_user_cellphone] => 123-456 789 [field_user_private_email] => private_smith@somewhere.com
Ok, now we know where to go to access certain information. Use the info above to create somthing like:
Ubercart theming in Fusion
Our team has created countless themes for Ubercart and seen others struggle with theming for this e-commerce suite that is ever growing in popularity. Fusion gives you a big head start when theming for Ubercart. If you don't need the Ubercart features, you can simply delete the node-product.tpl.php file (and node.tpl.php if you don't need it, since it will now inherit Fusion Core's node.tpl.php).
Product node template
Fusion includes custom functions for manipulating the display of Ubercart product data, and a custom node-product.tpl.php for easily moving these around.
Each Ubercart product class is a new content type, but all of these will use the node-product.tpl.php file.
Ubercart helper CSS
Fusion Core also includes some basic styling for Ubercart to help improve the display of your catalog grid and checkout.
OpenLayers Layer Type API
The OpenLayers module supports layer types, which are ctools plugins. Layer types are related to layers: layers are exportables which contain per-layer configuration, like map server URLs and parameters. Layer types are plugins which provide the forms necessary to create new layers and the functionality of those layers on a map. For instance, the openlayers_views layer type contains the method required to pull data from views and insert it into its own features array.
For instance, the code of the MapBox layer type is
<?php
class openlayers_layer_type_mapbox extends openlayers_layer_type {
/**
* Provide initial values for options.
*/
function options_init() {
return array(
'maxExtent' => array(-20037508.34,-20037508.34,20037508.34,20037508.34),
'baselayer' => TRUE,
'serverResolutions' => openlayers_get_resolutions('900913'),
'resolutions' => openlayers_get_resolutions('900913'),
'maxExtent' => openlayers_get_extent('900913'),
'projection' => array('900913'),
'baselayer' => TRUE,
'layer_handler' => 'MapBox',
);
}
/**
* Options form which generates layers
*/
function options_form() {
return array(
'layername' => array(
'#type' => 'textfield',
'#title' => t('Layer Name'),
How to build your own sub-theme (6.x-2.x)
- IMPORTANT: In Drupal 6, the theme system caches template files and which theme functions should be called. What that means is if you add a new theme or preprocess function to your template.php file or add a new template (.tpl.php) file to your sub-theme, you will need to rebuild the "theme registry." See http://drupal.org/node/173880#theme-registry
Drupal 6 also stores a cache of the data in .info files. If you modify any lines in your sub-theme's .info file, you MUST refresh Drupal 6's cache by simply visiting the admin/build/themes page.
The base Zen theme is designed to be easily extended by its sub-themes. You shouldn't modify any of the CSS or PHP files in the zen/ folder; but instead you should create a sub-theme of zen which is located in a folder outside of the root zen/ folder. The examples below assume zen and your sub-theme will be installed in sites/all/themes/, but any valid theme directory is acceptable (read the sites/default/default.settings.php for more info.)
Why? To learn why you shouldn't modify any of the files in the zen/ folder, see Why use Zen?
