Drupal – Check if a User has a specific role

Here is a quick way to determine if a user has a specific role:

 

Drupal – Adding Javascript to your module

When creating your own Drupal module, you may need to add some styling or Javascript to improve the usability of your module. Here is how to do it.

Similarly you can add CSS to your module as well

 

Drupal – Use hook_form_alter() to set redirect path on the form

One popular use of this hook is to change the destination of a form submission. Here is how it is accomplished:

 

WordPress – List Scheduled Posts

If you ever wanted to show you readers posts that are scheduled to be published, here’s how to do it.

 

CSS – Cross Browser Opacity

A little hack to set Cross-Browser opacity.

 

WordPress – Disable Auto Save

WordPress’s Auto-Save feature is a really nice but there are some drawbacks… this feature increases your database usage. So for those of you that are on really bad shared hosting accounts or just want to turn it off, here’s a quick way of doing it.

Open and insert the following line in your wp-config.php file.

Another method is to remove all of the entries from the database from time to time. You can do tun this query to do it:

 

Prototype JS – Determine if an object exists in the page loaded

I’m so use to using jQuery that I usually don’t have to look up documentation on how to use certain functions. They almost come naturally because it’s so English-like! Unfortunately Magento uses Prototype as it’s native choice of Javascript Frameworks. I sure wish they would have chosenjQuery! I think they would have more people jumping on their platform. I’m sure they have a good choice for it. Anyway, here’s how to check:

 

Magento – Check if a User is logged in

You may want to check if a user is logged in with Magento, possibly to display a link or promotional item. Here’s how to do it:

 

Magento – How to Display the Product SKU

Magento is a pretty flexible platform. That flexibility comes with a price though; You have to be knowledgeable of the functions that are available to you to utilize. Finding or knowing them is a challenge though. Here is one of those such functions that you may need to display the product Sku on a category page.