Drupal’s page serving mechanism
Ajay on January 31st, 2008An excellent topic to understand the flow of Drupal’s page serving mechanism
Call to undefined function db_query()
Ajay onDrupal provides the function db_query() to interact with database.
This function is defined in includes/database.inc file.
You have to include database.inc in your file to get db_query() working.
<?php include(”includes/database.inc”); ?>
However if you are trying to access drupal database from a non-drupal .php file then all you need to do is to include following lines at the top of your file.
require_once ‘./includes/bootstrap.inc’;
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Drupal Theming - How to print the attached image?
Ajay on January 29th, 2008If you are modifying Drupal theme and wish to play with attached image then following code might be helpful.
This code prints attached image (to a node) .
<?php
foreach ($node->files as $file)
{
$fileType = $file->filemime;
if($fileType == ‘image/jpeg’)
{
$imagePath = $file->filepath;
$imageTitle = $file->description;
print ‘<img class=”contentImage” width=”100″ height=”80″ src=”/’.$imagePath.’” alt=”‘.$imageTitle.’” title=”" />’;
}
}
?>
You can modify it as per your requirements. The above code prints all the attached images.
Free Wordpress Themes
Ajay on January 19th, 2008List of useful Wordpress Plugins
Ajay onFollowing is a list of most useful Wordpress plugins.
Make sure that these plugins are compatibble with your installed wordpress version. It is common that some of plugins might not be immediately updated to be compatible with latest Wordpress release.
WYSIWYG
Most of the above plugins can be seen in action on following blogs
SwamiWebDesign Blog
SwamiSEO Blog
target=”_blank”Ajay Kumar Singh
SwamiPC Blogs
SwamiLaptop Blogs
My Favorite Websites
Ajay onCorporate Websites
A K Singh Limited
SAIPL
Desktop PC / Laptop / PC Accessories / Laptop Accessories
Desktop PC
PC Finance
SwamiPC Blog
Laptop
SwamiLaptops Blog
Web Design / Web Development / SEO
Web Design
UK Web Design
Web Design Blog
India Tech Forum
SEO
SEO Blog
PHP Real Estate Scripts
PHP Real Estate Script
PHP Real Estate Script UK
Jobs
India’s No. 1 Job Site
UK Jobs
Text Advertisement
Text Advertisement
Text Advertisement UK
Text Advertisement India
Bharat News and Views
Sanatan Bharat
Freelancing
Freelancing
Freelancing Blog
UK Immigration
Immigrate To UK
UK Immigration forum
UK Online Shops
PC
Laptop
Jewellery
Health and Nutrition
Megavista
Megavista Global Directory
Megavista Blog
Drupal pathauto tutorial
Ajay on January 14th, 2008pathauto module could be extremely frustrating for any newcomer to Drupal.
pathauto module generates URL automatically based on the pattern which you specify in the configuration.
pathauto home page: http://drupal.org/handbook/modules/pathauto
First delete the alias settings for the types for which you wish to change pathauto settings.
E.g. if you want to change the Category URLs then delete all existing aliases first before making changes or else the new changes will not be reflected.
pathauto configuration for Category
Set the default path setting to be [vocab-raw]/[cat-raw] and you will get a very nice hierarchical URL.
See it live on www.SwamiPC.co.uk - http://www.swamipc.co.uk/desktop-pc/acer
URL Path Settings
While adding any page/product etc you can specify the name of URL and it will be automatically generated.
Uncheck the Automatic alias box and add the name which you want to be displayed in URL for that item.
E.g. for About us page I specified about in URL path settings which gives me URL http://www.swamipc.co.uk/about
Reasons why I don’t like Drupal
Ajay on January 13th, 2008Reason No. 1
It is not developed by native English speaking people. This is biggest drawback of Drupal which is reflected in almost all aspect of Drupal for which I don’t like it.
Few years back when I first started exploring Drupal I gave up as I could not understand the way it was written.
On the contrary it just took me 10 minutes to setup my first Joomla based web site.
Reason No. 2
It is too complex. I’ve worked with almost all of open source packages and it is undoubtedly the most complex CMS package to work with
Reason No. 3
The contents are not organized as it should have been. They got nodes then they added taxonomy and topped up with terms, vocabulary etc and all these hotch potch takes all your time to figure out what to put where.
Reason No. 4 - Ecommerce
They are trying desperately to integrate ecommerce package into CMS. I appreciate the effort and see it is almost coming good, however the basic framework of Drupal itself is not organized and adding ecommerce further makes it complex to glues everything together.
Reason No. 5 - SEO
Begin SEO guru I always look for an easy way to enable SEO freidnly URLS, keyword etc but Drupal gives me sleepless night in getting it together.
Reason No. 6
It is slow. It takes time to load after mouse click, it really takes a lot of time.


































