Technical Blog

Zyxware default image4
| 2 min read
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: <?php print count(uc_cart_get_contents()); ?> You can theme the content accordingly to show the contents in style: <?php print count(uc_cart_get_contents()); ?> items
Zyxware default image2
| 2 min read
The Drupal Views module provides pagers that lets you browse the items in the View via AJAX. Most of the time using the pager to view the next page will leave you at the bottom of the page when you expect to go to the top. This usually turns out to be a nuisance. Views currently does not provide a way to fix that. But there is a workaround to let you scroll to the top of a View after using a pager to load the page in your Drupal site. Read on to find out more.
Zyxware default image3
| 2 min read
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. Code:
Zyxware default image2
| 2 min read
Drupal Views is an incredibly useful module for Drupal users. This means that it will be a frustrating experience if it breaks by any chance. You might encounter a situation where the Views admin interface suddenly stops working leaving you with a broken UI with a flat set of lists with no AJAX and no theme. If you are experiencing a broken Views in your Drupal site and want to know the fix, read on to find out.
Zyxware default image3
| 3 min read
Drupal Views allows you to output results in a variety of formats including a grid view. There might be a situation where you would want to insert an additional div tag inside the td tag of the grid view to bring in additional styling like having a custom background color and spacing between the grid elements. You can implement this in two ways in your Drupal site. Read on to find out more.
Zyxware default image3
| 2 min read
Drupal Webform can be used to create forms and track the results of submissions in your Drupal installation. Drupal Webform can also be used to send confirmation emails to users when they have successfully completed submission. There could be instances where you might want to send an attachment along with confirmation email. Read on to find out how to add an attachment to the confirmation email of a submission in a Drupal Webform.
Zyxware default image2
| 2 min read
You have created a View for a custom content type and wanted to bring out info related to the node author. However you failed to find the Node: Author Name in the list presented by the Views Fields while all the other relevant fields for this content type are available there. So what could be the wrong and where is the missing field in the View? The fix is pretty simple. Read on to find out more.
Zyxware default image4
| 2 min read
You have created a Drupal View as a page and the View is working correctly as intended in the preview section in the View settings page. However when you visit the actual page it throws up a 'Page cannot be displayed' error after you had clicked on the View button on the Views settings page. So what is causing the problem and what could be the fix? Read on to see the solution. <!-break-->
Zyxware default image3
| 2 min read
If your Drupal site has some content which is restricted to certain users using hook_node_access you might find that the Views you create might bypass these hook_node_access restrictions granting unauthorized users complete access to view the content. The permissions might come into place only when the users click on the title of the node. If you need to know how to fix this, read on.
Zyxware default image2
| 2 min read
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.
Fix Certbot Auto-Renew Error in Ubuntu
| 3 min read
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.