Article in Time.com on measuring user behavior with metrics like clicks etc.

I’m asked a lot about metrics for measuring traffic, engagement etc. etc. Even though on a daily basis I have to deal with complex developing, people management, daily requests and tasks I still find grasping truth behind the behaviour of our end-users/ readers a slippery kipper…

So I must make some time to finish reading the following article from Time.com on what we think we know about measurement, click-throughs, clicks etc. compared to pausing, engagement and how it all fits together with social sharing.

Time article “What You Think You Know About the Web Is Wrong”

Using Pathauto functions in a block to create lists of Taxonomy terms and their associated nodes/ content with a custom content type where one node could have multiple terms

The problem

I came across a need to write a custom block in Drupal 7 which dealt with Taxonomy terms in a custom Taxonomy vocabulary. In this block I needed to list all nodes that were associated with that Taxonomy term, the problem was that one node could have multiple terms associated with it in the Views field. I started out using Views for this but found no way to prevent the Taxonomy terms from being listed multiple times per node so I decided to reverse the approach and list the terms in the Taxonomy which had the specific vocabulary.

For the full explanation of the problem see this post on Drupal Answers.

In working on this I went in circles for about an hour creating invalid URL aliases to match the clean URL pathauto alias that I had generated when the content was first created. However what I needed was to obviously match the path that was created in the first place. I realised that the way that I was going to do this was by returning back to the Pathauto module and checking through that api.

The solution

This is how I ended up getting it to work:

$vocabularyID = $row->taxonomy_term_data_vid;
      $termID = $row->tid;

        $path = drupal_get_path('module', 'example_sites');
        include_once($path . '/example_sites.api.php');
        $nidArray = fetch_node_ids_by_term_id($termID);
        $path = drupal_get_path('module', 'pathauto');
        include_once($path . '/pathauto.inc');

        foreach ($nidArray as $nid) {
            $node = node_load($nid);
            $string = $node->title;
            $cleanTitle = pathauto_cleanstring($string);
            $url = 'category/' . $cleanTitle;
            //below is just applying a class for CSS styling etc.
            $options['attributes'] = array(
                'class' => 'category-with-term',
            );
            $link = l($node->title, $url, $options);
            print $link;
        }

Please be aware that fetch_node_ids_by_term_id($termID), here:

        $path = drupal_get_path('module', 'example_sites');
        include_once($path . '/example_sites.api.php');
        $nidArray = fetch_node_ids_by_term_id($termID);

…is actually just me consulting the database, you can replace all that with this…

    $nidArray = db_select('taxonomy_index', 'ti')
        ->fields('ti', array('nid'))
        ->condition('tid', $tid, '=')
        ->execute()->fetchCol();

Learning How to Theme in Drupal – Finding the Right Beginner Guide to Theming for Developers Who Already Have Experience in Drupal

When it comes time to learn something new in Drupal, the best thing that I can recommend for you to do is to search for the best place to start. Invest a little bit of time so that you can be fairly sure that the area that you are about to start looking at for your guide is the right place. I’ve wasted a lot of time on books and websites that either have bad information, out of date information or are too focused to be of any help.

When it came to theming, I found that the best thing to do was to watch this video but accept that you might not understand everything it says. Then download a theme, open the theme in e.g. Eclipse, setup with XDebugger, set breakpoints in .tpl.php files and template.php files and debug – watch the process, following the debugging through the files and you’ll understand just how complex it is. At this point you might want to go back over the video.

I then made a mistake and tried to get too deep too fast, by all means mess around with the code, experiment and play around but don’t aim for it to be your final version, that’s a waste of time – don’t try and take shortcuts.

After messing with CSS and even changing the ordering and the contents of a page (possibly even liking what you’ve seen) you then need to get back into structured learning. I would then suggest you read the first few pages of the Drupal documentation on theming and then watch this drupalize.me video which really helps you to see what is being discussed.

A simple and easy practical guide for beginners on setting up your Drupal web development environment with Wamp, virtual hosts, Eclipse IDE and XDebug debugger

Starting out with Drupal or require some help with setting up your web development environment?

Drupal is becoming quite common, I know people who have jobs in development organisations that focus solely on Drupal development for their clients and one person’s job is just to ‘theme’ those Drupal builds. The chances are that Drupal will become more commonplace for web developers as clients look for increased functionality that sometimes lacks in WordPress (Joomla is another that is often spoken of for this purpose but that’s not something I can help you with) but don’t want the overhead of creating a bespoke system from scratch (which also wouldn’t be regularly updated by a large open-source community).

The first thing to say is that you need to be confident in your development setup – if you already have a good knowledge of debugging and a PHP IDE setup then I don’t need to say any more on that and you can skip the next section – if however you aren’t using virtual hosts, you don’t have a secure debugger, you’re using Windows and you aren’t confident with your IDE then the next sections are for you and I advise you to work through them slowly but surely.

Let’s start setting up your development platform

If you’re using XAMPP I recommend removing it and installing WAMP, I ‘grew up’ with XAMPP but WAMP offers so much more for a beginner/ intermediate developer (and beyond) and if you’re not that confident at editing configuration (config/ conf/ ini) files then get rid of that XAMPP and (or just, if you’ve not got anything yet) download that WAMP!

Issue 1

When downloading WAMP be sure you take note of their recommendation on C++ redistributables – i.e. download and install them. Be aware of your Windows type (32 bit or 64 bit – for an explanation and more information on this check out Microsoft’s guide, but come back). This is important and if you don’t know yours then click Start > (My) Computer > System Properties (a tab towards the top) and there in the ‘System’ section you’ll see your  ‘System type’. Make sure you know it because there will be repercussions later if you don’t.

Download WAMP

Next head on over to WampServer’s homepage to get that lovely stuff. Click on ‘Start using WampServer’ (as of March 2013) and you’ll find a variety of options to download. Great – that’s a good thing! Now if you look at the options, you’ll see it’s slightly misleading as all of the options have Apache, Mysql, PHP, XDebug, XDC, PhpMyadmin, SQLBuddy and webGrind. The versions of these might be different, but don’t worry about that – instead pick the first one in the list that corresponds with your system type – either 32 or 64 bit (unless you specifically have to choose a certain version of something, in which case select that with your appropriate system type)

Now take note of WampServer’s notices and download the Visual C++ Redistributable if required. If you’re not sure – download the one that corresponds with your system type (32 or 64 bit) anyway, the installation screen won’t offer an installation offer if you’ve already got it, instead it will say repair, remove or similar – cancel the process and ignore the Program Compatibility Assistant’s prompt that it might not have installed correctly. After you’ve checked the redistributable, choose the first link in the first paragraph on the WampServer download screen (as of March 2013 this is ‘you can download it directly’ – I won’t include a link because that circumvents the selection of 32 bit or 64 bit as I’m running 64 bit and that link will likely be out-of-date soon anyway). You’ll be taken to a Sourceforge page where you can run/save the file – one way or another you’ll want to run it.

Install WAMP

Allow the installation if you’re prompted by a Windows warning and welcome to WampServer’s installation wizard. Click all the usual disclaimers and select additional icons etc. if you want, in other-words keep clicking next. The extraction of the files will take a minute or so on a modern processor.

When that’s done it will ask you for your default web browser, find your Firefox/Chrome etc. folder (Computer > C: > Program Files (86)) and select the .exe or as it says, ‘If you are not sure, just click Open’ to use Internet Explorer. Installation will finish and you’ll have to select the appropriate networks for it to be working on, I’d advise limiting it to Private networks, ‘such as my home or work network’. Allow that access and click next on the SMTP and Email options, because the chances are you’re not running a mail server on your laptop! Finally we can launch WampServer.

Run WAMP

Now you should notice a little ‘W’ icon in your system tray (bottom right) that turns from red, to orange then to green. Then, helpfully, it will disappear. We want that icon to appear permanently in your system tray as you’ll be clicking it a lot. Left click the white up arrow to the left of the system tray and click ‘customize’. Find your WAMP icon (listed under ‘Aestan Tray Menu’ on mine) and choose ‘show icon and notifications’. Now you should have a little green ‘W’ in a box in your system tray.

Setup virtual hosts

This might seem an extraneous step, but it’s far better to get this step nailed now before you start wishing you had a separate sandbox-type (i.e. a safe and independent ‘play thing’) for when you want to try something out or when you inevitably have more than one project on the go.

Setting up virtual hosts is simply a process to follow (detailed here) that allows you to have more than one ‘website’ running on one machine, and it’s commonplace for webhosts to allow for such a thing so it’s worth doing.

Issue 2

If you’re not experienced (at all) in Linux type systems (and therefore file management) or you generally only concern yourself with the actual website’s folders, then this is where WampServer really helps – it provides shortcuts to commonly used files that we need to edit for the virtual host setup. However it can be a good excuse to start familiarising yourself with file management systems that are above and beyond the Windows ‘My Documents’ style setup, so you might want to have a go at finding the files yourself in the Windows Explorer system (the folders and files display from C:\ onwards). Another thing to note is that it’s good to have file extensions being displayed – if they aren’t then to do that click Start > Control Panel > Appearance and Personalization > Folder Options > View (which is a tab) and ‘un-tick’ ‘Hide extensions for known file types’.

Windows Hosts file

The next step is to enter the brave new world (if it’s new to you anyway – otherwise please excuse my condescension) of the Hosts file. This is located in

C:\Windows\System32\drivers\etc

Helpful tip

A quick way to get there is to select…   C:\Windows\System32\drivers\etc   and copy that into the navigation bar at the top of the Windows Explorer and press return. Otherwise, work your way up the file path.

You should see a folder with hosts, lmhosts.sam, networks, protocol, services or some-such variety.  Interestingly you’ll note that there are no extensions being displayed here (except lmhosts.sam) because there are none, but it’s still important to display them. Now we open hosts, but wait for there is another issue to take note of…

Issue 3

It’s important (and will save you headaches) to realise that although we’re in Windows, not Linux, we do still sometimes have to run certain things as administrator (this should be OK if you are logged in as an ‘administrator’ Windows User Account). Editing the hosts file requires this, so before we open hosts, find Notepad and right-click it, rather than left clicking it as we usually do, and select ‘Run as administrator’ (with a shield icon to the left of it). Allow the User Access Control when prompted then go to File, click Open and find the hosts file (again, copy   C:\Windows\System32\drivers\etc   into the navigation bar at the top and it will take you straight there. It’ll look empty, because it’s looking for files with extension ‘.txt’, so next to ‘File name:’ click on the file type button with the down arrow that currently says ‘Text Documents (*.txt)’ and select ‘All Files (*.*)’. Yata! There you’ll see hosts, open it!

Editing the ‘hosts’ file as administrator

As it says at the top (commented out with #s), this file maps IP addresses to host names, which means we can map our localhost (the not-over-the-internet, not even requiring an internet connection, local network that exists just on our machines) to various host names (‘website’ names) that we want to further match with folders on our computer (i.e. ‘localhost’ network location otherwise being known as ‘somesitename.local’ -> C:\somesitenameDevelopmentProject\). The reason this is helpful is because otherwise we would need to be using a folder in WAMP that is C:\wamp\www\somesitenameDevelopmentProject\ which can get irritating and makes setting up a PHP debugger slightly more cumbersome.

We don’t need to do much here but it helps if you understand the concept underlying this process. You should already have an entry

'127.0.0.1        localhost'

That’s showing us that we have an IP address of

127.0.0.1

which is the loop-back interface of our machine, allowing us to be both server and client – exactly what web developers need. This IP address is matched with the hostname

'localhost'

We want to add entries that match 127.0.0.1 with whatever we want to name our address to access it over a web browser, so if we go with ‘sandbox’ and give it the extension ‘.local’ (for our pleasure) we want an entry that looks like this…

127.0.0.1    sandbox.local

[TO BE CONTINUED] – apologies for the lack of an ending here, but I figured I’d never finish the guide if I didn’t at least post SOME of it!

 

http://drupal.org/node/75242#templates

 

Eclipse download

Eclipse is a widely used development environment for various languages, the one we’re interested in is PHP so what we need is Eclipse and the PHP Development Tools (PDT) plugin. I was using Eclipse Helios for a long time and really wanted to upgrade to Eclipse Juno, but I’ve had various problems with Juno and PHP configuring, so instead I rolled back a release to Eclipse Indigo.

The Zend package is a good one to use so you don’t need to fetch the PDT elsewhere and is packaged (unsurprisingly) in a way that works ‘out of the box’. So visit the Zend site for the Eclipse & PDT package and download the Eclipse Zend PDT .zip. Once that’s downloaded, extract it to somewhere like C:\…

Issue xx

When unzipping, Windows can seem to place your extracted contents inside another folder, since we’re looking to create

C:\eclipse-php\eclipse-php.exe

We want to unzip the contents into C:\ so select that as your destination.

Since Eclipse doesn’t ‘install’, if you want to create a shortcut, do so by right-clicking the eclipse-php.exe and following the creating a shortcut procedure.

Eclipse project setup

Now we want to integrate your existing Drupal structure with Eclipse. If you’ve not actually yet installed Drupal – follow this guide http://drupal.org/documentation/install but bear in mind that we don’t want to put our Drupal extraction into a htdocs or www type directory – since we’ve setup virtual hosts.

 

can have problems with associating content types to php syntax colouring in Eclipse Juno, …

used .. instead

http://www.zend.com/en/community/pdt/downloads

 

install a plugin

http://groups.drupal.org/node/39938

i.e. —    http://xtnd.us/downloads/eclipse

How do you know which form is which when writing hooks and custom PHP code in Drupal

Beginning Drupal can be tough, as I’ve previously written. One thing that drastically improves Drupal PHP development is knowing which form is which. Drupal (at least at the seventh version) is heavily based around forms. Pro Drupal 7 Development by John K. VanDyk spends an extremely large amount of time on forms to the detriment of explanations on Panels, Pages, Views and just about everything else that a builder/ developer needs to learn about.

But I digress, use of the following code in a .module file for your module (replace the “My_Module” part with the name of your own module) will show you which form is which by just visiting it. Vital for all those form_alters etc. that come along in development work.

The code

function My_Module_form_alter(&$form, $form_state, $form_id) {

    drupal_set_message("Form ID is : " . $form_id);

}

Have fun!

Keep it simple, don’t overstretch with your PHP systems design

I’ve recently had an inherited part of a system completely give up the ghost with many areas breaking maximum execution times. When I dug a little deeper it became clear that in one procedural passage of script there was a horrendous mix of stuff going on. It became immediately obvious that reconstructing it would be a month or so’s job. In the end I questioned the staff member who had direct interaction with it and instead of one processing script dealing with five or six logical functions, we could encapsulate the problem, strip off all of the attached complexity and have one water-tight section.

Using Views API to add custom schemas, programmatically add your custom tables to the Views UI in Drupal

I have spent quite a while trying to find the correct place to read documentation for the Views module and how to programmatically add your custom tables in Drupal, one incorrect phrase in your Google query and you end up going in circles. The best place to start, when you’re looking for more than just a guide to using the UI is here – http://views-help.doc.logrus.com/help/views/api-tables

Send variables from a Views rewrite link to hook_menu in Drupal

How to send variables from a View (Views module) in Drupal to an instance of hook_menu was causing me an unnecessary amount of time to figure out. I assumed that I would need to supply the wildcard in the hook_menu $items[] entry, this was part of my confusion. The second was that I would need to add a trailing slash ‘/’ in the rewrite results section of the Views link (to do this – visit the Views area

http://drupal.dev/admin/structure/views

Go down to ‘Fields’ and click on the field that you are using as a link.

(note: for some reason you may have to manually change the order to get other variables from the View to be passable as ‘tokens’ (this usually seems to mean moving your linking field down below the others you want to make use of)

Open the ‘Rewrite Results’ panel and head down to ‘Replacement Patterns’ there you’ll see that using [uid] == User: Uid. This means you can provide a ‘Link Path’ (back up a little way on the form) which has the variables you have taken from your Views setup (before I get onto how to write this out, take note of the following).

Then assuming you have a hook_menu implementation that has an item value…

$items['foo/bar']

where your hook_menu location is essentially being recognised as

'http://yourwebsite.com/foo/bar'

Do not try and provide a location that makes use of the URL with the attached _GET (the variables you set above. I started trying to use /foo/bar/%, then /foo/bar% before I realised that actually to hook_menu that URL I just want the plain /foo/bar, not mentioning any wildcards for any _GET variables at all.

Now when you use your ‘Link Path’ from the Views UI you can write

 foo/bar?userID=[uid]

In order to make use of the _GET variable when the hook_menu fires and triggers your callbacks…

$items['foo/bar'] = array(

    'title' => 'foobar',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('foo_form'),
    'access callback' => 'user_access', //don't worry about these if you're not used to permissions etc.
    'access arguments' => array('access foo_form'), //... and this one!
    'type' => MENU_NORMAL_ITEM,
    'weight' => -1,
);

 

you should be able to have your callback (in the same file, if you’re not used to putting them in different ones yet)
that has the following (or something similar) that will give you that variable…

/**
* Page callback.
*/
function foo_form($form, &$form_state) {

    $uid = $_GET['userID'];

    //etc. etc....

Eclipse 57% XDebug loading issue

note: If you have previously had a working version of Eclipse and XDebug and you’ve recently had this issue – jump to the bottom of the article.

If you’re using XAMPP – delete it (I have had many a problem with it), then install WAMP/ WampServer (if you’re on Windows).

Once you’ve done that and you selected the XDebug settings in the WAMP installation, you’ve setup virtual hosts as you want and that’s working, you’ve created a customised debug configuration specifying Xdebug over Zend etc. and everything seems to be setup EXACTLY as it should and yet you’re not seeing any variables, you’re not getting a Debug perspective shift, then head on over to your PHP.ini – left click the WampServer icon, then hover over PHP to see a shortcut, or follow the file extension, something like…

C:\wamp\bin\apache\apache2.2.22\bin

 

then you need to make sure you add the following lines

 

    xdebug.remote_enable = on
    xdebug.profiler_enable = off
    xdebug.profiler_enable_trigger = off
    xdebug.profiler_output_name = cachegrind.out.%t.%p
    xdebug.profiler_output_dir = "c:/wamp/tmp"
    xdebug.remote_handler = dbgp
    xdebug.remote_host = 127.0.0.1
    xdebug.remote_port = 9000

 

 

UPDATE:

As of around March/ April/ May 2013 there seems to have been some issues in Java updates – version 1.7.0_21

To check your Java version go to Start, type "cmd", press return. Once the command prompt is open type "java -version"

This stack overflow post on Java, Eclipse and the 57% percent XDebug issue seems to be really on-the-money, for this most recent issue. My fix was simply to uninstall (through the usual Windows add/remove programs) the Java listed and visit Oracle’s Java archive to download a previous version (For me this meant choosing Java SE 7,  Java SE Runtime Environment 7u15, and then ‘Windows x86 Offline’ (30.05MB) | jre-7u15-windows-i586.exe) although you do have to sign up you can remove yourself from Oracle’s mailing list by following their link (disingenuously described as a button) in the footer of the registration page after you’ve finished signing up.

Mass Effect: The back, exit, square and circle mapping predicament in video game control learnability

I’ve owned every generation of PlayStation consoles, so I guess it’s fair to say I like them. What I don’t like is bizarre mapping. For some reason in the original Mass Effect game they decided to make the ‘Galaxy Map’ contravene PlayStation conventions.

When playing video games, controllers are usually quite set into a context of use that is determined top-down, every now and then though you get strange choices that developers have made. The circle button has widely been used as a ‘back’ button for many years now and when you compare this to web browsers, smartphones, and tablets you have an ability to control your hierarchical position in the information architecture or menu system etc. When using the Galaxy Map* though, circle becomes ‘exit’ and you end up leaving it, rather than going back a stage in the hierarchy that the Galaxy Map provides in zooming in and out. In this situation, ‘square’ zooms us in, but the opposite button, ‘circle’ does not zoom us out (or take us ‘back’). ‘Back’ has become ‘exit’ and exit has an extremely strong power over us in user interface use. We each fall into a subconscious process that should mean technology is merely an enabler of our desire to achieve something. When we are thrown out of our cognitive flow we are disturbed and we immediately become aware that actually we are being used by the menu, not the other way around. Technology is not something that we should have to feel like we are using. As Matt Saunders from Citrix said at a recent seminar, is for it to “just work” – no smoke and mirrors, no instruction manuals – we use it not the other way around. This is clearly a bug-bear for me and one that demonstrates the power of learnability.

Learnability has a lot in common with memorability and wider conventions in the context of the device use – it makes no sense to try and impose a new system into a context of use that so many people will have become so familiar with for so long and that works. Part of the reason why Microsoft’s Ribbon interface heralded praise and criticism alike is that it was a true sea-change in a program that many millions of people have become familiar with for many years. Every day I hear criticism in the office of the Ribbon and yet every week I find it speeds up my report writing. Revolution here seems a necessary step for Microsoft to have taken. But something as minimal as a back button in a video game should not require me to re-write my subconscious processes – especially when the point of a video game is to immerse oneself.

*It’s worth pointing out that Mass Effect 2 and 3 both do not have this problem – and that part of my bug-bear experience is that I (as many other PlayStation owners will have) played Mass Effect 2 and 3 first.

Can’t login to Drupal after moving from a server to development, development to server, or just moving Drupal around at all using WAMP/ WampServer?

All of the recommendations and guides on the internet are great (takes a couple of hours to implement all the changes they suggest) but when you’re ABSOLUTELY sure that you’ve fixed everything and all the phpMyAdmin root@localhost problems, the MySQL user accounts, the Drupal settings.php, the virtual host problems and STILL YOU CAN’T LOGIN TO THE DRUPAL ADMIN PANEL…….

enable rewrite_module for Apache…..

Man this has given me such a headache over the last few weeks of moving developments around.

Since my post title is specific to Wamp I’m assuming you’re looking for a Wamp solution…

  • Left click the Wamp icon in the system tray
  • Hover over Apache
  • Hover over Apache Modules (just extended – probably to the left)
  • Click the caret/ down arrow until you get to ‘r’
  • ‘tick’ “rewrite_module”

I’m afraid if that hasn’t worked (after a once-more-for-luck ‘Restart All Services’) then your search continues my friend… good luck.

How to store and add extra information about Drupal’s users

Intro

I find Drupal to be a brilliant yet frustrating CMS. There are so many simple things I have wanted to do in my time learning Drupal, yet some fairly simple beginner Drupal questions like ‘how do I store extra information about a user, for example when they register?’ become frustrating.

Drupal is more than a blogging system, so it’s understandable that these sort of questions are asked – fortunately Drupal developers (seem to be) a helpful and accomodating bunch, and most of your frustrating issues have likely been answered.

Solution

In short, go to

Drupal > Administration > Configuration > People … ‘MANAGE FIELDS’ tab

which is likely to be a URL like

localhost/admin/config/people

There you can find tabs on the top right of the active window (not the first place I looked, that’s for sure) greyed out one should be ‘MANAGE FIELDS’. There you’ll find fields to fill that are similar to something from phpMyAdmin, similar because they are used in the database storage.

Once you’ve set them up, if you go to your Drupal database you’ll see that you’ll have a new table field_data_field_foo where foo is the field you would have just created.

There’s a bunch of interesting and flexible things that you can do from there, but that’s another story…

PHP function array_search() working with if, while conditions

The problem

Our array

$foo

has at index

 [0]

the value

1010 (an int).

As below…

$foo = array(1010, 1011, 1012, 1013);

But I was not getting a result in the function…

array_search()

This wasn’t immediately obvious as I was not searching for the first index in my first search. But when you consider the following PHP, it will not break at the first condition test and echo.

if (array_search(1010, $foo)) {
    echo '1010';
}
if (array_search(2010, $foo)) {
 echo '2010';
}
if (array_search(3010, $foo)) {
 echo '3010';
}
if (array_search(4010, $foo)) {
 echo '4010';
}

The solution

This seems to be because it will return 0 (the index’s value) but the if condition takes that as meaning FALSE so the solution is to add an explicit part that says if not FALSE in value and type, but makes no mention of returning 0 as an int. See below…

$foo = array(1185, 1196, 1206, 1209, 1210, 1215, 1217, 1218, 1222, 1235);

if (array_search(1185, $foo) !== FALSE) {

    echo '1185';
}

Recommended resources:

http://uk3.php.net/manual/en/function.array-search.php

Xampp not working properly? Try WampServer to fix all those virtual host configuration and installation problems

From XAMPP to WampServer or why I changed

A little PHP development is fine, but when one starts to get ahead and using more complex processes and perhaps working on more than one site at a time – we start to need more in our development environment.

I have been a user of XAMPP ever since I first started using PHP. I found the simplicity was a cure for all those long and hard-to-follow tutorials about Apache and MySQL installation etc.

My, how things have changed.

I decided that enough was enough and instead of trying to deal with the headaches of various error messages and half-explanations on various forums about trying to setup virtual hosts on XAMPP, I was going to throw in the towel and try something else. Cue WampServer.

WampServer was one of those one-click installations that I was hoping for. Aside from the minor hiccup of having to install a Microsoft C++ Distributable (common on most systems, but not on mine as I’d recently reinstalled my OS) there were no problems at all with just getting it up and running. But, I have to say, there were still one or two issues with setting up the virtual hosts. However it is worth the temporary headache!

I’ve yet to pluck up enough courage to setup XDebugger though.

Recommended Resources

http://viralpatel.net/blogs/how-to-setup-multiple-virtual-hosts-in-wamp/

http://cesaric.com/?p=255

http://www.kristengrote.com/blog/articles/how-to-set-up-virtual-hosts-using-wamp

 

PHP is Valuable, Drupal is Interesting, but Learning Curves can be Steep

Drupal is a beast, it is a content management system (CMS) that deals with open-source  communities (that’s not to say others don’t) which leads me to often paraphrase Apple’s marketing drive “There’s a module for that”. It does however have an extremely steep learning curve (more of a learning cliff if I’m honest). So whilst adopting a CMS is seemingly commonplace now, if you’re not that knowledgeable about PHP or general computer science and programming principles I advise taking things very slow and I advise you to expect a very stop-start learning experience.

Helpful resources

I recommend a book or two, as well as a browser loaded with Drupal-based resources. Embrace the video-tutorials and do not be afraid to have a cheat sheet or two handy (recommendations to come).

If all you are doing is looking to style (‘theme’) a pre-existing back-end or just automate the back-end by downloading someone else’s setup then you may be able to avoid the hardcore end of coding but for any big project it is likely there will be some code noodling where existing modules miss all that you desire.

Drupal’s documentation

Drupal has been maligned in web-spheres from time to time for its documentation. I have noticed Drupal requesting volunteers to get it in good-shape but to be honest I find the search feature located at Drupal’s API Reference very helpful, especially when you compare it to MySQL’s. Often the custom modules will vary in the quality and depth of documentation, it’s not always an accessible place – especially for those without the experience of using version control and understanding code by reading through it. But don’t give up – there are plenty of forums with people raising the kind of query you may end up having.

Don’t hide from Drupal and PHP

It can give you an extremely rewarding learning experience, whilst shielding you from the hardcore Drupal core working. It can help you to learn computer science principles and it’s never a bad thing to absorb other group’s practices. After graduating with a Java background and styling regular and relatively easily predictable HTML (PHP created or otherwise) it became apparent that, really, why would a business want to take a slow path writing everything themselves when they can rely on secure and effective open-source code that will be able to be auto-update-able whenever there are bugs etc. discovered. Don’t fear the future, don’t fear a dumbing-down of web development, adopt the agile approach or the lean approach, or whatever approach you want to use to approach it. Go with it.

Is Hiding Functionality the Worst Case of Bad UX and Usability? Looking at Twitter and Gmail on Android

Two of my most used Android apps – Twitter and Gmail – have both hidden major functionality from me. Both of these apps have made me very frustrated with them for not letting me do things in my process which I can do elsewhere.

Twitter

With Twitter this is getting right to the top, first tweet – the most recent tweet. Sometimes I’m not interested in my Twitter stream on my phone and don’t check it for a week or so. When I come back to my Twitter app I find there are hundreds of tweets to scroll through and the most usable scroll feature on Android (‘Music’ in the stock Android apps) has one of those bigger scroll blocks that you can quickly scan through at far faster pace, short-cutting to a different letter in the alphabet. So I try and use that. It doesn’t work. I spent many, many months not really caring too much about something so unimportant as my Twitter stream and getting frustrated at how long it takes to gesture-scroll up to the top.

But wait…

Turns out that when I stopped, turned off auto-pilot and looked at it I realised that maybe I could press ‘home’. Sure enough it took me to the first tweet.

Twitter hiding functionality

Pressing ‘home’ should take me home, right? Wrong. Pressing ‘home’ takes me to the newest content, the top of the tree in temporal terms. ‘Home’ should be somewhere near the beginning, the first, the bottom, you know – home? That’s what it means to me anyway. Home is a homepage, an index page, a landing page – not a node in a stream. Tsst tsst, don’t hide such a useful feature by trying to be too clever with your IA, UX, whatever – just geez, I don’t mind reading a few extra words if it means I don’t go months, months and a few more months without realising I can do what I’m getting frustrated about doing.

Don’t be too clever for your own good!

 

Gmail

Now I think I’m actually quite liberal with my frustration towards Gmail, far more developers and designers seem to have a true hatred for Gmail, although that might just be Google’s web-app version (which, incidentally, is terrible for accessibility of icons – talk about generic, ambiguous shapes that mean nothing to a lot of seasoned web surfers).

I assumed (again) for months and months that I could not see my sent items. That it just wasn’t possible in the Android Gmail app. Who wants to waste time Googling how to do something so basic as seeing your sent items? Well I didn’t, and as a result Gmail has cost me time. As Gmail seems to combine emails from a person, with the same ‘re:’ (say if they’ve replied a few times to you, but you’ve not read it since they’ve sent another reply) I would check that. Only it then puts my sent item in that conversation. But if there wasn’t a conversation in the first place then I couldn’t see what had been sent based on my mental model of this frustrating Android app.

Gmail hiding functionality

So Gmail has done a similar sort of thing. The block housing the word ‘inbox’ has no affordance that underneath lurks key functionality. There I can find my Outbox, Sent Items etc. Really there isn’t much use for email at all if there is not automation of the basic functionality of outboxes and the like (something the core Android ‘Email’ app clearly does include). So frustrating!

Don’t try and be too smart about it. Keep it simple stupid!

 

In summary

What is the point in building something big and powerful in functionality, only being ‘too clever’ with your UX and hiding it from your users? I can’t see one.