Articles

JRoute and module visibility

Submitted by bas on Sat, 12/09/2009 - 20: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:

Related nodes and custom breadcrumbs

Submitted by bas on Fri, 21/08/2009 - 17: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.

Further tweaks

Submitted by bas on Sat, 15/08/2009 - 02:49

Codeculture.nl just got a bit better. The site was (and still is) in dire need of some tweaks to the interface. There were a couple of problems that needed addressing:

  1. I wasn't happy at all with the placement of the search box, it just took too much space and broke the flow of the first lines on the front page. Also I wanted to include the search box on every page and remove the search option from the main menu.
  2. The breadcrumbs looked dull and were hard to read on the striped background under the header.
  3. I started colour coding the pages with a simple rotator, so you get a fresh look if you refresh the page. However I didn't fully implement this. In the near future I'll probably dump the rotator and use the colour codes to brand specific pages.
  4. I found the main menu font colour to be a little too light. Click stats affirm this.
  5. There were some very serious cross browser issues (well, IE issues really, but let's be kind on microsoft for a change). There still are some problems especially with IE7, but at least the site functions properly on all major browsers.
  6. The project thumbnails on both the project gallery and the project nodes were inconsistent and badly delineated.

SEO and performance

Submitted by bas on Tue, 21/07/2009 - 15:46

Discussions on Drupal site optimisation are usually technical discussions. But many a time they boil down to philosophical discussions. Search engine optimisation (SEO) and performance tweaks aren't necessarily good for the manageability of your site or for your potential visitors. I ran across a couple of these dilemmas in recent days while trying to optimise my own site.

Business cards

Submitted by bas on Sun, 28/06/2009 - 01:29

Business card front, back in rolloverLast week I got my new business cards. The folks at Zalsman did a great job printing the range of colours carefully selected by Rob Krijgsman.

Movie embedding

Submitted by bas on Wed, 17/06/2009 - 12:34

Despite some seriously evil legal terms, I moved the instructional videos for the Joomla-SugarCRM bridge from blip.tv to vimeo.
The guys at blip.tv weren't able to deliver xhtml 1.0 strict validating embed code. I considered youtube. But the encoding quality of vimeo, when it comes to screen casts, beats the crap out of youtube's encoding.

Photo tour of the new office

Submitted by bas on Thu, 21/05/2009 - 00:25

Many thanks to Kor for providing this slideshow tour of the new office in Haarlem.

Tweaking the site

Submitted by bas on Thu, 14/05/2009 - 11:59

Since a week I'm working in Haarlem every Tuesday, Wednesday and Friday. With the good folks of 2Value we're manning a new office at the Kenaupark. The synergy of sharing an office location can be a really good thing. One of the benefits is always having a usability guru around. Kor pointed me at some shortcomings of this website. Some of them I solved today.

Dutch Joomla Days 2009

Submitted by bas on Tue, 05/05/2009 - 13:26

Joomla!days Netherlands, 12 - 13 June 2009, NieuwegeinThe Dutch Joomla Days will take place at 12 & 13 June 2009 in the Mercure hotel in Nieuwegein. The event is aimed as much at the Joomla community as it is at professionals. The two day event will have a business - and a community oriented day.

New Layout

Submitted by bas on Tue, 14/04/2009 - 02:05

Code Culture has a brand-spanking new layout. My wonderful friends Leon and Rob from WAT Ontwerpers have concocted a colourful corporate identity, logo, and website design. The drupal theme for this website, I built myself. Though this is still a work in progress (and it probably will be a work in progress for the remainder of it's life), many of the elements of the new design are in place. Let me point out some highlights:

Pages