Joomla-dagen 2010

1 February 2010 - 17:06

I'll be attending the Dutch Joomla Days. This year the event takes place on 23rd and 24th of April in Utrecht.
Joomla!dagen Nederland, 23 en 24 April 2010, Utrecht

Henstra Advies en Ondersteuning

21 November 2009 - 11:05

Harm Henstra is a coach and interim manager based in Haarlem. He needed a small, straightforward website to present himself and his services. So rapidly I put up a new Joomla installation. After a short planning meeting Harm wrote most of the content in his new website. I structured it and filled the site. We jointly choose a stock template and I adapted the colours and feel to his corporate identity. Next, we put up the "pawn" images and portraits to finish the global layout. Finally I gave a small instruction on how to use Joomla to manage the content in the website. In under two days the website was finished. The resulting website is clean, easy to navigate and reflects the "game" theme of Harm Henstra's method.

HTML style guide

16 September 2009 - 13:49

When designing websites graphic designers often draw a neat picture in photoshop. The day to day use of a website greatly differs from this ideal scenario. The design shows a calm and readable site with demo text. But the actual website in use everything but serene and readable. The text style is usually the first aspect of a site that gets diluted. Both users and visitors create content or leave comments which just don't fit the initial picture painted by the designer. A lot of problems stem from the use of wysiwyg editors in content management systems. These editors usually grant their users a lot more freedom than a web designer wants. A properly configured wysiwyg editor should greatly limit the possibilities of the user to a few essential functions such as creating lists, inserting links and marking text as strong or emphasised.

However, many a time such wysiwyg editors are incorrectly configured. If users have too many text formatting options the result is text corruption. Because of their limited knowledge of html code, users mess up semantics, introduce a diversity of text styles, insert many incorrect tags and a plethora of inflated code and inline styles. The more creatively inclined user seems to have an urge to colour pieces of text, raise the text size, insert alternate fonts and create unused or endlessly nested tables into the content of your carefully designed site. Once users start copying and pasting from MS Word they introduce a visual cacaphony which seriously breaks the visual appease of your site. Sometimes it can even break the basic layout of your site and hinder search indexation.

JRoute and module visibility

12 September 2009 - 19:04

Correct SEF routing in Joomla is pretty easy thanks to the class JRoute. If you want to redirect to a clean url just use the basic method _(); like so:

JRoute::_('index.php?option=com_example&task=view');

Unfortunately, this method isn't aware of url aliases created in menu items. JRoute just alters a dirty url like /index.php?option=com_example&task=view in a clean url like /components/example/view. Let's say you've created menu item to this components task with the alias: /view-example. JRoute doesn't redirect to the alias, just to the cleaned up system url. This is a problem because menu items are essential if you want to define page parameters or module visibility. These parameters are only visible if the url matches exactly. If you want to create redirects to url aliases in your Joomla modules or components you can try the following snippet.

$menu =& JSite::getMenu();
$menu_items = $menu->_items;
foreach($menu_items as $item) {
    $match = 0;
    if($item->query['option'] == 'com_example')    $match = $match+1;
    if($item->query['task'] == 'view') $match = $match+1;
 
    $matches[$match] = $item->route;
}
if(key_exists(1, $matches)) {
    array_shift($matches);
    array_reverse($matches, false);
 
    $action_url = JRoute::_(JUri::base(true).'/'.$matches[0]);
}

This will create a path to a single alias created in a menu item if a matching menu item exists. You can also do this for other components by specifying the match criteria. For example:

2Value Subversion

6 September 2009 - 14:32

2Value is a network organisation. In this organisation I am among a growing number of associates who create high quality open source software solutions for the web. The network character is one of the great strengths of such a company. However, you need a set of effective procedures and collaborative tools for such an organisation to work effectively. In the last couple of months I worked on implementing Subversion and localised environments in 2Value.

Subversion (mostly known as svn) is a revision management tool that allows software developers to track the history of a development. If you work with a number of developers on a single project, you want to make sure that everybody uses the same codebase, that changes to the code are logged and documented and that code changes are repeatable, reversible and exchangable. In other words: you want a team to work together on a single code base without the individual team members mocking things up for their peers. Now there's more to implementing a tool like svn than just making it technically available. You have to educate the participants in the use of the system, write guidelines on how to use the system and start using it in real life situations. So I've organised workshops, written documentation, setup the subversion hosting (at unfuddle.com) and operationalised the new methods at some of 2Value's customers.

Related nodes and custom breadcrumbs

21 August 2009 - 16:38

Sometimes, having an easy to use CMS like Drupal or Joomla is just one more excuse to keep on tweaking. Just now I added a related nodes block to the article and project pages. Let's say I write an article like this and I tag it drupal. A couple other articles on the same topic are shown in a block in the right column. Hard to do? I don't think so! Just use the views module an some view arguments, like so.

There's more stuff I changed in the last week or so. I completely changed the functionality of the breadcrumbs. I wanted them to reflect the structure I use for clean urls. But I wanted to use page titles instead of the url shorthand (and lowercase) terms. So I created a little snippet. Let's say I have an project with a fairly simple url like /projects/world-domination.

  1. first I fetch the url and system path
  2. then I breaks it up in into parts using the / as divider (so I have 3 parts: /, /projects and /projects/world-domination)
  3. for each part I check if the url is pointing to a valid page.
  4. for each valid target page I fetch the page title
  5. then I return all the breadcrumbs with valid links back to the theme
  6. If the clean url path wasn't found, the normal system breadcrumbs are used as a fallback mechanism

and... Presto! A simple breadcrumb bar for all the project nodes. Including "Home" and the current page's title. Off course I needed to find other solutions for Views, Taxonomy, System paths, etc. but that's a longer (and even more boring) story. I anyone's curious how I did it. I'll send them the code.