PHP

PHP

Canonical meta tags for drupal multiple domain sites

by John McGeechan

Synopsis

 Slight enhancement to domain_source module to add canonical meta tags to node. Canonical meta tags can improve SEO

Easily Define preprocess functions by content type in Drupal

by John McGeechan

Synopsis


A shorthand way to provide preprocess "hooks" for any content type.



This snippet can be placed in a template or your chosen module, I usually place this in both the node and page preprocess function eg

Drupal plugin written in Jquery to increase or decrease web elements or font sizes

by John McGeechan

Synopsis

 A handy little Drupal plugin that let's users increase/decrease fonts with a single click

nb I tried  the official drupalfont  resizer, but could not get it working, on the off-chance that you have the same problem...

A Complete PHP REST solution

by John McGeechan

Synopsis

A client requested the construction of a limited set of web services. Simpler solutions created the foundations for these services via a set of generic classes and libraries.

Details on how to implement these are given below

Signature Verification

by John McGeechan

The signature verifier script provides a simple way to validate the arguments passed to a function. Most functions sanitize their arguments before proceeding. Often this is via a set of repeated checks ie checking that a required field is not null or that it is the correct data type (array or int for example). If a function requires many arguments then this can result in a lot of code before the function can start it's actual work. The aim of this class is to abstract out as much of this as possible to improve readability and cut down on code duplication.