Web Development

Web Development - Tips, HowTos, Starting, Utilities, Editors, Languages etc.

Image popup / popout effect when hovering over an image - How to implement using jQuery adipoli plugin on Drupal/non-Drupal sites

Enabling the jQuery effects on a page is now no more a mess. Using a plugin called Adipoli, it is as simple as this to show different effects for our content:

  1. Add the necessary js files and css files.
  2. Select the element on which the effect is to be applied.
  3. Invoke the tooltip plugin.

So here is the code:

How to write consistent and cross-browser compatible CSS - Ideas for Margin, Padding, Border, Height, Width

Almost all the browsers have different settings for base margins and padding. It is always important to set margin and padding for the body and html tags while styling web-pages. Otherwise it might result in some inconsistencies while displaying the pages across various browsers.

We can avoid such inconsistencies by setting margins and paddings on html and body tags to 0.

[Drupal] What is DTD and how should it be implemented in a Drupal website?

DTD stands for Document Type Declaration. We have been using this as the header in all HTML files since the very first day we started working on HTML. But have you ever wondered what it does or what can happen if doctype is not specified? Read on to know what is DTD and how it should be implemented in a Drupal website

How to backup (dump) and restore a specific table in MySQL using the terminal / commandline utilities provided by Linux

As a web developer, we sometimes may want to export a specific table from a MySQL database. It can be particularly helpful when we are going to apply some changes to a table that is part of a large database and we are interested in backing up that specific table only, rather that whole huge database.

To create a backup (also called dump) of the a table use this command:

[Drupal] How to dynamically update Ubercart cart products count in Drupal?

October 19, 2012 - 16:48

A Drupal+Ubercart site with a store where users can purchase your products and no links to indicate the number of products anywhere in your site seems too annoying. It would be nice if there is a way to update the cart count as soon as a product is added to the cart.

Here is the code snippet to get the total number of contents in the cart:

[Drupal] How to add a custom admin settings form to accept variable values in Drupal?

Sometimes the best way to handle variable value changes on a Drupal site, would be with an admin settings form to show/edit the value. For example, while implementing a "send test mail" functionality on a Drupal site, we might want to set the recipient address at testing time. It would be easy to create an admin settings form instead of changing the addresses each time in code.

How to generate filenames from a given string by replacing spaces and special characters using PHP preg_replace()

You might have come across a situation where you need to set the title of the content as the filename for an uploaded image or where you might need to replace the spaces and special characters from the filename of an uploaded file. In such conditions you can use preg_replace. I will show you some example code where the output string will be nice and clean and can be used for setting file names.

[Drupal] How to implement multiple color switches in Drupal theme?

Implementing multiple color mode switching is so simple! In HTML we can easily add the switching color style sheets as alternative style sheets.

But when it comes to Drupal there is a slight change. Here is how we can implement multiple color switches in Drupal theme. We normally include style sheets in .info file and we cannot specify 'alternative stylesheets' just like in HTML. So here we need a module called Drupal 'Styleswitcher'. By enabling this Drupal module you will get the option 'styleswitcher' to add alternative style sheets.

For more details just follow these steps.

[Drupal] How to enable dynamic page titles in a Drupal 6 website?

You might wish to have dynamic page titles in your Drupal 6 website. It is good for a website for the title to change according to the content of a page from an SEO perspective and also for a better content structure. It is very easy to implement dynamic page titles in a Drupal 6 website. Follow the steps below to change the page title according to the url of the page.

[Drupal] How to print a view in a node in Drupal 6 website?

There are many situations where you need to print a view within a node in your Drupal website. A good example would be a portfolio page showcasing the Drupal websites you have done using a view slideshow that showcases screenshots of your work. It is not directly possible to print a view within node just like there is no direct method to print a block within a node. However as Drupal is a very flexible CMS and there are methods to print just about anything and that includes printing a view within a node.

Zyxware releases new Drupal 7 Theme - Lightword - ported from Lightword wordpress theme

We have ported and released another Drupal 7 theme from another popular wordpress theme - Lightword. The Lightword Drupal theme - is now available on Drupal.org. You can read more at the home page for Lightword Drupal theme at our free Drupal themes site. As with our other Drupal themes, the theme is released under GPL 2.