Archive for Wordpress

Drupal vs. Wordpress

I’ve been working on a Drupal site this past week or two. I had done absolutely zero with Drupal before that and had to essentially power learn the CMS just for this project. As this was straying away from my comfort zone, Wordpress, I started keeping in mind comparisons to Wordpress. I have to admit I am still a noob to Drupal and don’t know all the tricks so the below opinions should be taken with my situation in mind.

Drupal
Pros:

Integrated PHP into Content - Wordpress has different plugins that let you use PHP in posts but Drupal is far and away more efficient at this.

Awesome User SystemThe user system on Drupal works really well and very extendable with really advanced permissions.

Integrated AdministrationContent administration is built right into the main theme. Wordpress has 2 different sides, the site and the admin backend.

BlocksThis is more a neutral than a pro. Blocks can get annoying to edit here and there when Wordpress sidebar widgets are much easier. This is more like Joomla, in that you set different sets of content into specific areas of the page called blocks.

Cons:

Manual Module InstallWordpress lets you search and automatically install plugins right from the backend

Complicated ThemingCreating themes was very complicated in Drupal, at least for me. There are a few strange things when you are new to Wordpress, The Loop for example. But I had a much harder time with drupal.

Lack of customization
This is the most frustrating thing for me. I like what modules do for me but I need to style the output I get back. For most of my issues I had to go in and edit functions inside the module files and even the core files itself. That is some really advanced stuff for a supposed user-friendly Content Management System. In Wordpress, I RARELY had to edit plugins since they offer enough css to style it or plenty of other options. If I did you could edit it in the backend or in dreamweaver in glorious COLOR. Drupal uses a .module extension which you have to add to Dreamweaver to tell it it is safe to even open it. Plus there is no color scheme to a .module extension even though its all php. Thanks for the hassle. Also, the Wordpress plugin/hook system is much easier to understand then the Drupal API layering.

Debugging
This might only be my case but I ran into multiple problems where what was showing is not even close to the logic used. What my source html and CSS code was listing contradicted what my eyes say. I have just noticed a weak error layer with Drupal.

Documentation/VersionsDrupal comes in a few different versions but the problem is many have drastic changes. How something is coded is changed in each version. You can’t say you know Drupal unless you know how to make a site in each version, 4, 5, AND 6. Wordpress has compatibility issues between versions, mainly in plugins, but change in actual core functions is VERY minimal in WP. Drupal’s multiple version also resonate a whole other problem. Documentation is HORRIBLE. Drupal’s home site will tell you how to do different functions in each version but not alot of example or variations or implementations, and most of all a huge lack of help when trying to find out what arguments a function takes and what they do. Worse yet, to find solutions for your issues on any other site is a nightmare since how you handle something in Drupal 5 could be completely different than 6.

Now if I got a little more comfortable in Drupal AND I had to build a huge community-type site, I would consider Drupal. Just the user system would save a bunch of time that way. But for any other type of site I can’t see any reason not to use Wordpress.

I guess this post wasn’t a very close argument in my mind. A more close comparison might have been Joomla vs. Drupal but I’m not sure if I could make a verdict on that. But the point of this post is…after a week or so of pure Drupal grinding all I could do was think about Wordpress as if she was the girl that got away.

Getting $_POST variables in a Wordpress Plugin on save

I’ve been making more and more wordpress plugins lately and it seems to me that a vital part is getting certain variables back once a post is saved. I had a bit of trouble on this since the logical hook of save_post() was not returning my variables. After a lot of messing around I came to the conclusion that if you use the init() hook you can pull your variables and do whatever actions there, however keep in mind, on init() wordpress is not loaded so you can’t use wordpress functions.

Anyway here is an example…

function checkCheckBox()
{
    global $_POST;
    if($_POST['checkbox'] == 1)
    {
       return true; // You would more likely set an option or define a constant here instead so it can be more global
    }
    return false;
}
 
add_action('init', 'checkCheckBox');

Hope this helps someone, I know it would have saved me alot of time if I knew.

List Subpages Plugin for Wordpress

Today I had to figure out a way to list subpages of a certain page in its wordpress content. After mulling around my options I decided I might as well make a plugin.

This plugin is very simple and straightforward. Just enter “

    ” on each parent page or post where you want the children listed. Put it anywhere in your content and that is where it will show.

    Then in your css..

    .subpage-style {  Put your styles here };

    Easy as pie!

    You can pick the plugin up right Here

    Upgrading Wordpress MU from 2.6 to 2.7

    I know I’m late to the game but I tried upgrading wordpress from version 2.6 to 2.7 today.  I ran into the seemingly all-too-common redirect loop which seems to have to do with the wp-config.php keys and salts.

    Thanks to a comment on the wordpress forums, I was able to find a resolution, which was to remove the block of KEYS and SALTS entirely from the wp-config.php file.  Then, upon login, MU notifies you that your keys are incorrect and asks you to update them.  A simple fix to something that I thought would be a major problem.

    I have to say, Wordpress 2.7 is significantly better than 2.6 AND 2.7 MU is even better than that if you are running multiple blogs.  What fun!

    Listing Wordpress Categories Inside the Loop

    The Request—

    Be able to list all of the blogs categories inside the loop on a page or post.


    The Solution—

    After some playing around in the template I decided a plugin is the best route.

    Plugins always have a  header in comments that wordpress uses to describe it in the admin backend. I filled out my customization of this.