Finally an inline editor for Drupal 7

For some clients, the lack of an inline editor in Drupal for simple changes adds a real barrier. Many of the small businesses I deal with have never run a site and are terrified by the prospect.

I was really impressed when I saw the HTML5 Aloha editor http://aloha-editor.com, but was frustrated that the work on a D7 module has stalled.

For those who enjoy hand rolling their own the first thing is to embed the plugins and javascripts into your desired template eg:

Styling long form lists as multiple columns

To avoid the frustration of endless scrolling when adding a new node with multiple fields and tick boxes consider using

Selling theatre seats via D7 Commerce

I am

exploring using

http://drupal.org/project/commerce to sell dated products like theatre performance seats and presently only an 8 seater theatre! I started by adding a product type called theatreseat and gave it additional fields/attributes
field_dateperf
field_seatnumber
I then did the labourious task of creating unique products to represent every combination eg 8seats x 4 days 32 products.
I then created 2 product displays and linked the first 2 days products to King Lear performances and the last 2 days to Hamlet.

the demo can be seen at

Send content to Facebook and Twitter

Now you don't need login to different social networks to post status updates. Just one click and your content will be posted to

Facebook
Twitter
LinkedIn
FriendFeed
The most common way to make your site popular is by posting your content to different social networks. Here is a new and simple way for publishing content to different social networks.

I recommend using http://drupal.org/project/postiteverywhere

Takes a while to setup but a good readme file

Add event direct from each date on month calendar

This tutorial was created using a fresh Drupal 6 install with Garland theme.

Add a [+] to each date on a month calendar, like the excellent [l:http://openatrium.com OpenAtrium] can do

First ensure /calendar is working and that you can add events

get and enable module https://drupal.org/project/prepopulate

Create a drupal6 module called addplus containing the following code

function addplus_preprocess_calendar_datebox(&$vars) {
global $user;
if (user_access('create event content', $user)) {
$options = array();

Add colour to events in monthly calendar

Client brief:

Show the different coloured backgrounds to events based on tags

Method:

first go to admin/content/taxonomy/add/vocabulary and create a new taxonomy called calendar >

link it to event node type and add terms eg dropin, office, outreach, shop that reflect the

type of events that you wish to highlight.

then at node/add/event create a few test events all with different taxonomy terms

at admin/settings/date-time/formats add a new format g:ia and link it to a new format type

hourmin_g:ia > save

How many RSS subscribers?

Q - How can I count the unique subscribers to my website's RSS feed?
A - Use use PHP to find out via accesslog ...

Create block with the following code in it:

<?php
$rssreaders
= db_fetch_array(db_query("SELECT COUNT(DISTINCT(hostname)) AS hostname FROM {accesslog} WHERE path LIKE '%/feed' OR path LIKE 'rss.xml'"));
?>

Currently we have

<?php
print $rssreaders['hostname'];
?>

RSS subscribers now.

Content adding for the terrified!

I often face concern from new clients worried that they wont have the skills to run their own website. Unfortunatly (despite what we may think) a glance at all the options available at node/add/story does little to ally such worries, despite assurances of "don't worry/ignore this that section/field".

With this in mind I was determined to use modules/roles/css to create the simplest of starting points to help users gain confidence. (see after/before image opposite)

Download and install http://drupal.org/project/better_formats

Designing for IE - all of them!

So you create your beautiful Drupal theme, tweak it to perfection using Firefox and Firebug, send the url to the client, confident of praise and adulation.

Then the dreaded response "I'm looking at it in Internet Explorer 6 and...". As you can't run multiple versions of IE on the same machine, previously I have used old machines running different versions of IE, and tools like [l:http://logmein.com LogMeIn] to check browser compatibility but now there is a simpler way.

Use a different template based on node type

Insert this code into template.php

function phptemplate_preprocess_page(&$vars) {
  // are we on a page that displays ONE node?
  if (arg(0) == 'node' && is_numeric(arg(1))){
    // Then let's get the node object
    $node = node_load(arg(1));
    $suggestions[] = 'page-'.$node->type;
    $vars['template_files'] = $suggestions;
  }
}

Pages