Services

  • Drupal CMS Websites
  • Drupal and PHP Developer
  • Custom solutions in PHP/MySQL/jQuery

Welcome

Welcome, I am a Web Developer based in Estepona, Costa del Sol, Spain originally from the UK. I studied Computer Science & eBusiness at Loughborough University. I specialise in Content Management System websites

Drupal

Pasat 4b Payment Method (uc_pasat4b) setup instructions

I was receiving errors from the bank system after having installed the uc_pasat4b module - http://www.ubercart.org/project/uc_pasat4b. After having used the sermepa system for every other website I have built, I was totally confused as to why it wasn't working and why the module wasn't sending all the data that I thought it should be.

Remove "not verified" from comments

Just insert the following code into your template.php in your theme...

<?php
function phptemplate_username($object) {

if ($object->uid && $object->name) {
// Shorten the name when it is too long or it will break many tables.
if (drupal_strlen($object->name) > 20) {
$name = drupal_substr($object->name, 0, 15) .'...';
}
else {
$name = $object->name;
}

if (user_access('access user profiles')) {
$output = l($name, 'user/'. $object->uid, array('title' => t('View user profile.')));
}
else {
$output = check_plain($name);

Using date popup fields from the date module

I found it hard to find information on how to implement a date field in your forms using the form API. I actually wanted a date popup field. Below is the code for using it

$form['dob'] = array(
  '#type' => 'date_popup',
  '#title' => t('DOB'),
  '#date_format' => 'Y-m-d',
  '#date_year_range' => '-100:+0',
);

You can also find more options here http://drupal.org/node/292667

Place a link to a view page next to the node edit link

I was trying place a link to a views page in the tabs that appear on nodes, I wanted it to appear link "Node Edit MyNewLink". The way to do this is to set the page URL "node/%/MyNewView", and create a normal "menu tab". The link will automatically appear, just make sure you replace "MyNewView" in your view path to something relevant.

Display signature in User profile page

I was really surprised that Drupal as standard did not show the user signature on the user profile, it doesn't even give you the option! It's really simple to do if you know how but took me a while to figure out.

You must create a module (see drupal documentation for doing that) and paste the following in...

function MYMODULE-NAME_profile_alter(&$account) {
$account->content['summary']['signature'] = array (
'#type' => user_profile_item,
'#title' => t('About the writer'),
'#value' => $account->signature,
'#weight' => -1,
);
}

Drupal Views2 - Display all values if no results with exposed filter

I had an issue where I had a google map showing the locations of results, and a filter which helped you zoom in on locations. Basically you typed a location and the map showed the location of the results as well as some listings. However, if there were no results, instead of showing an empty page, I wanted the google map to appear with all results and an error message. What I did was set up an "Empty text" value which called a views function "views_embed_view()", I then created a block within that view but without the exposed filter (actually removing that filter all together).

Views 2 - Don't list / Exclude current page

If you want to create any normal listing based on category or content type and say have it appear in a block across several pages, but want to make sure that the page you are currently on doesn't appear in the list, then the below should help
Instructions made from a collection of information found in Drupal website...

1). Open up your view
2). Create an argument of Node > Node id.
3). Then choose the radio button option of "Provide default argument"

Drupal 6 pay2publish / Pay per Node

I needed a pay per node solution for Drupal, I was very surprised at the distinct lack of modules for this in Drupal! I have started to port the uc_nodetype module for ubercart but have hit some issues. If anyone is interested in helping me with this, then please let me know.

It mostly works quite smoothly, the only problem I have is trying to display the node edit form on the cart checkout page, it either breaks the page or doesn't show any field elements. It should be such an easy thing but I can't figure it out.

Drupal 6 Install schema doesn't create any tables

Basically I was creating a module and it wasn't creating any of the tables I had told it to set up in my .install file, and as far as I can see there weren't any mistakes.

What I found out was that because I had already installed and activated the module once, it wasn't re-running the install file and thus creating the tables.

All you have to do is disable the module AND uninstall the module. You will probably receive an error saying that it can't find the tables to remove but thats fine, thats the problem we are having!

My Drupal 6 block template file doesn’t work

I had the problem whereby I wanted to change the theme layout of the locale bar. The devel module told me to use the template file “block-locale.tpl.php” but when I created this file and populated it with dummy information, it did nothing. I tried clearing the cache and still could not get it to change the content of the locale block.

In the end I found out that if you do not have block.tpl.php (example code below for you to start with) in your theme then block-locale.tpl.php gets ignored.

Syndicate content