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:
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.
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.
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.
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.
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.
We have released a new Drupal theme targeted at small business blogs. The Business Blog theme - is now available on Drupal.org. You can read more at the home page for Business Blog Drupal theme at our free Drupal themes site. As with our other Drupal themes, the theme is released under GPL 2.
We have released a new Drupal theme targeted at individuals and small businesses. The Black Blog theme - is now available on Drupal.org. You can read more at the home page for Black Blog Drupal theme at our free Drupal themes site. As with our other Drupal themes, the theme is released under GPL 2.
We have released a new Drupal theme targeted at small business websites. The Media Blue theme - is now available on Drupal.org. You can read more at the home page for Media Blue Drupal theme at our free Drupal themes site. As with our other Drupal themes, the theme is released under GPL 2.
We have released a new Drupal theme targeted at small corporate websites. The Business Yellow theme - is now available on Drupal.org. You can read more at the home page for Business Yellow Drupal theme at our free Drupal themes site. As with our other Drupal themes, the theme is released under GPL 2.
Developers often overlook CSS as something very simple and not requiring a lot of thought. This leads to poorly thought out CSS rules, CSS abuse, inefficient CSS and ultimately bad rendering performance and slow page load times. Here is a simple tip to improve CSS performance and page load times - avoid descendant selectors.
Cross browser compatibility is one of the most important concerns of an HTML/CSS developer. Here’s how you can easily add shadow effect to your div blocks with cross-browser compatible CSS. Simply add the below code to the div to which the effect is to be added.
We start thinking about global variables when we want something to be available just everywhere. One case is when we want a particular variable to be available to all modules in a site. In Drupal, global variables are usually defined in settings.php. With that, all modules can access that variable.
When you want to move a Drupal site from one hosting server to another you have to ensure that the site works the same way on the new server as it used to work on the old server. There is no real fool proof way of doing this other than to meticulously document all the custom aspects associated with setting up the site and verifying it on the new server. The following is a checklist of information you have to collect before you move your Drupal site from one server to another.