Tuesday, August 24, 2010

DrupalConCPH day 2 underway

Wolfgang Ziegler is presenting the Rules module, and is getting started...

Rules are reactions to events. Events, as we all know, are the basic function of calling a Drupal URL.

Rules 2- Drupal 7 only is the order of the day at this session.

Rules 2 retrieves all content from node metadata, taxonomy can also be metadata. A possible client to Rules2 could be e.g. Services Module.

Rules 2 supports arguments through a Data Selector, and through direct arguments from tokens, data selection and data processors. Data processing could be date-manipulated input, or e.g. Data being summed through arithmetic.

Looping over listed content is a primitive, and need not be handled through php loops handcoded. Lists also feature insertion and removal operations; list_remove, list_add etc.

Reuse and saved rules are copyable and configurable for each entity/copyable of the first implementation.


- Posted using BlogPress from my iPhone

Location:Center Boulevard,Copenhagen,Denmark

Day 1 - DrupalCON CPH - Drupal, Joomla, WordPress, Typo3...

Point of departure
Comparing Drupal to Joomla, WordPress and Typo3 had the focus on this day one...
WordPress and Typo3 were thoroughly showcased by their "official representatives" - professionals dedicated to the two platforms/systems.  Joomla and Drupal was showcased by a German guy*, who also has authored books on both - at developer level for both systems.

Conclusions
  • A casual webuser, fed-up with the limitations of Facebook, MySpace and other hosted "blogger-solutions", are quite well served by WordPress
  • WordPress can be made to implement large sites, although is is NOT recommended!
  • Joomla is a bit of a legacy CMS system, quite capable, but marred by too many workflows that could well be improved, but are VERY integral to Joomla, so probably won't be.  Joomla is ONLY CMS not to currently include image-processing - Scaling, thumbnailing and soforth!
  • Drupal is great for websites, of pretty much any size, but the installation-process is tedious/overcoming for most newbies.  Drupalgardens.com may well serve as good starting point for WordPress-converts that want a free hosted Drupal-website.
    Drupal has, as a competing CMS, many things to learn in simplifications from WordPress!!! This is very clear!
  • Typo3 is by far the most advanced system of the four, but as seen from a non Typo3-tech's aspect, the system is just too daunting, also in everyday use for administrators.  Typo3 also has a very ambitious upgrade-path, and no particular support is given to assist the vital extension-developers in keeping up with "the curve", other than backwards-compatibility features. 
 
*: Will insert real name, when I re-read it...

Day 1 - DrupalCON CPH - Lessons/tips...

The following are the most important Drupal-related modules that were mentioned/debated at Day One of the Drupal Con CPH 2010:

The Modules
- Panels (Project-Panels)
- Display Suite (Project-DS)
- Data (Project-Data)
- Composite Layout for nodes (Project-Composite)

The Starter themes
- Zen
- BluePrint (Works with the BluePrint CSS library)
- Foundation  (comment was that it was in many ways FAR superior to Zen) 

Tuesday, July 27, 2010

Meets us at DrupalCon CPH 2010 (august 23'rd-27'th)

Morning.dk is now prioritizing Drupal very highly, as it has proven a great tool for delivering on-time and powerful solutions to our web-customers.  A part of this prioritization is attending DrupalCon CPH 2010, where we have high hopes of learning and networking with other Drupalists... Meet us there, and we'll talk :)

Highlights from the conference are the Keynote by the creator of Drupal - Dries Buytaert, as well as PHP-centric talks by several high-profile PHP professionals, as well as leader from the webdeveloping-community.  Clear-left and Ethan Marcotte will be talking of the future of HTML and HTML5.

Thursday, July 1, 2010

Drupal + nginx + fastcgi = smokin' hot website!

Drupal CMS is a bit demanding, as my previous posting re. APC Cache speedup pointed out. Apache Webserver is yet another beast of a system, and uses massive system processing power and RAM to run properly, especially in scaling to many concurrent requests. Nginx is a very high-performance server, and perfectly capable of smokin' Apache when running a Drupal site. This is accomplished through use of PHP in CGI/FastCGI mode.

Linux and Mac OS X servers can enjoy the fruits of the above setup, quite easily. Linux variants have their package managers, such as apt-get, yum and soforth. Mac OS X has the awesome MacPorts to accomplish the very same... an example for the setup is given at the link below, for Mac OS X. The situation for other Linux' is pretty much the same for installation and setup!

http://www.sussdorff.de/node/52

If you wish to run both Apache for some services and nginx for performance, then make sure to have them respond to requests at two different connection ports - typically 80 and 8080.

Tuesday, June 29, 2010

Checking whether a user has a specific role...

Drupal 6 makes it easy to check whether or not a user has a specific Access Privilege.  It is indeed used in most modules, as it is essential and yields much power and flexibility in use.

What Drupal 6 does however NOT make trivial, is to check whether or not a user has specific role ( a named role, e.g. "administrator", "authenticated", "member" - whatever roles you may use).
How-to
<?php  global $user;

 
// Check to see if $user has the administrator role.
 
if (in_array('administrator', array_values($user->roles))) {
   
// Do something.
 
}?>

Here we use the default full array that each user has as an attribute - the collected roles of the user!  Note that this array is keyed, and the role names (not unique!) are thus kept in the values of the keyed array!
Why is this useful?
Well, let's suppose that you have a list of nodes (a blog-style for example), and these nodes in the listing are authored by different users - different users with different roles indeed!  Using the technique above, will enable you to theme the blog-entries of each user-role, making it easier to visually tell them apart on-page for the reader of the blog.

Thursday, June 17, 2010

Accelerate drupal performance

Update: There are several modules available to Drupal 6 for caching pages, thus enhancing load-performance of your Drupal website.  I've personally tried the CacheRouter below, and have found this excellent article outlining an alternative - Boost & DB Maintenance.

Dedicated hosting setup
I just installed APC - the PHP opcode cache engine - on our server, and configured it as described in

APC Drupal Performance tuning

APC enabling & optimization makes Drupal websites SCREAM!

Shared hosting setup
If you are running your Drupal website on shared hosting, and don't have the option if APC ( as it is a server-wide installation, and not single-site!) then you might want to check out the Boost/DB Maintenance modules, or the one below...

CacheRouter Module
Update: I've tried this module on a website featuring AJAX loading of node content (through Views 2 Module), and experiencing rather high load-times with this combination.  Maybe Views 2 Cache needs to be enabled for the same content, maybe not.  I will test this later on - And please - if you test, then comment here... Thanks!

Tuesday, June 8, 2010

Page example module - Modules and menu routes

I was specifically searching for examples of how to create modules that present their content when called
through specific URL's in a Drupal CMS website. I came upon this example, and it looks quite simple and useable...

Module menu router example



Monday, June 7, 2010

Theming the "not-so-apparent" parts of Drupal content

An excerpt from the above-linked article/resource:
"You can create theme hooks for modules you did not write
When I wanted to theme the comments form the first thing I did was looking at comment.module. There I found a call like this:

drupal_get_form('comment_form', $edit, $title) 


Ok, I had a comment_form function that I could theme according to Drupal Form API, then I started looking for theme_comment_form but there was none.
How to override a theme hook that does not exist? Just as you do with your own modules, you just need to know the code involved and, this is important, you can include a hook_theme function in your template.php file. This is what I did for Woodpig:

function woodpig_theme() {
return array(
'comment_form' => array(
'arguments' => array('form' => array()),
),
);


The function starts with the theme name and the theme hook takes the form argument because it's a that's what drupal_get_form requires. Then I can write my own woodpig_comment_form($form) function."

Sunday, June 6, 2010

Nodes - Hooking into them, loading and saving with new overridden values

Check out this code-centric article on using hook_nodeapi in Drupal 6.  There are good code-examples and the section "Caveats" is especially worthwhile.