CCK with Imagefield and imagecache with drupal 5

Imagefield gives you the ability to add images to your content type, but image field alone can’t handle resizing and generating thumbnails, that’s why we’ll use Imagecache to handle the resizing and thumbnails.

Imagecache allows you to a create preset to manipulate images on the fly. You’ll understand a lot more about imagecache once we start playing with it.

Continue reading “CCK with Imagefield and imagecache with drupal 5”

If and foreach in drupal templates

Examples of using if and foreach in drupal or general php templates:

<?php if($test == 1): ?>
<div>do something</div>
<?php endif; ?>
<?php if($test == 1): ?>
<div>do something</div>
<?php else: ?>
<div>do something else</div>
<?php endif; ?>
<?php foreach($items as $item): ?>
<?php echo $item->getTitle(); ?>
<?php endforeach; ?>

Secure your site

How hard would it be to secure a drupal site? Not that hard really, all you need is to make sure your hosting has SSL setup and working, then redirect all traffic from HTTP to HTTPS. But is redirecting all the traffic to https the most efficient way? What if you only want the login form or admin section secured? Thankfully there is a module out there to help you out. Let me present to you: Securepages Module.

Continue reading “Secure your site”