Custom Module

How do I add my own PHP functions to Drupal

When you need to add your own php functions to drupal, you can simply embed them in the content, but that is not the best way.

The best way to add your own PHP functions to Drupal, would be to create your own function library module.

Lets hypothetically call your PHP function library "myfunctionlib", you will need to change that everywhere to reflect your own naming convention.

To create the PHP function library module first create a folder "myfunctionlib".

In that folder create a file called myfunctionlib.module with the following content:

<?php
/**
* Function Description
* @param function_parameter
* @returns function output description
*/

function myfunctionlibone($type="page") {
// php function code
}
function myfunctionlibtwo($show="list") {
// php function code
}
//don't close with ?>

In the same folder create another file called "myfunctionlib.info" with the following content:

Copyright block: a footer with php code in drupal (The Module)

A follow-up on Copyright block: a footer with php code in drupal<.

I've had some requests to make this a module , so here it is, and there is nothing spectacular about it. It is just an example on how to make a simple block module.

Another question was if you could put drupal copyright footer block< in your theme. The answer is yes, but then you would not be able to switch it on / off or change themes as easy.

CCK, Views and Contemplate. A Product display setup.

CCK Product Display - RV DealershipCCK Product Display - RV Dealership

I just came across some development snapshots made in 2006 on the development of a database driven RV dealership.

Remember this is Drupal 4.74 CCK,Views,Contemplate, one custom module and some tweaking here and there (sometimes with a pipe wrench).

One of the major things was the theme, and because the designer (at that time) had little theming experience (I think not much designers had then, and this was a good one), I did the initial theming.

Syndicate content