Technical Blog

Zyxware default image4
| 1 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. -->
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.
Zyxware default image1
| 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.
Zyxware default image3
| 5 min read
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 default image1
| 7 min read
Git is one of the most versatile opensource version control systems out there. If you have not already started using Git for your Drupal Development projects, this article should help you get started with it. Please note: I have been using Linux as my development environment, and almost all my illustrations would be for Linux. Still, the commands for using git should be the same for git implementations on all OSes. Please add in a comment if you have any doubts.
Zyxware default image1
| 5 min read
If you are creating a View using the Drupal Views module and if you want to filter nodes based on nids (Node > NID filter) then Views gives you options to filter it based on a single argument of the nid. Currently there is no direct way to have multiple nid filters in Views similar to "Is one of" for Taxonomy. However there is a workaround to achieve that. Read onto find out more.
Zyxware default image4
| 2 min read
Some Drupal users have reported that there was a conflict with an external Jquery script and the Views Ajax. This occured when the Drupal user wanted to use the external script for some specifc purpose. The conflict was causing the Views UI to break. If you are experiencing this issue in your Views read on to find out the solution.
Zyxware default image1
| 2 min read
Some Drupal Views users have encountered a Page not found error when they tried to navigate to the new Views Page files display they had created. This occurred after the preview page worked correctly and showed the correct test file in the table. It is not very clear what causes this error in the first place but there are multiple actions you can take to fix it. Read on to find out more.
Zyxware default image2
| 2 min read
Drupal Gmap module is a very useful module for embedding the functionality of Google Maps in your website. Currently the only way to access this map is to go to the "yoursitee.com/map/node and find all the relevant info on a single map. There is no direct way to access i location nodes on a single map, inside a block or panel pane, or on pages other than yoursitee.com/map/node. However there is a workaround for this. Read on to find out more.
Zyxware default image2
| 2 min read
Drupal Views can be displayed as both blocks and pages. If you want the View to be embedded in a node in your Drupal site then the obvious choice would be to display it as a block. View blocks can be embedded in a node as any other block by calling a set of functions like block_load and drupal_render. However it is not directly possible to pass contextual filters as arguments to those functions if your View uses them. Read on to find out how to pass contextual filters to a View embedded in a node.
Zyxware default image2
| 4 min read
The trick explained briefly We are not actually going to theme the file upload field as it is presently nearly impossible to do that. Instead we are going to put an ordinary looking 'dummy' input text field over the file field. Next we proceed to make the 'original' file upload field invisible but accessible to the user via CSS. So when a user clicks on the dummy input text field they are actually clicking on the file upload field itself. To make it authentic we are going to copy the file path from the file upload field to the text input field via javascript.
Zyxware default image3
| 4 min read
Are you looking for an easy way to delete hundreds and thousands of nodes in your Drupal CMS? We all know how to delete it using the normal admin panel which forces us to select all and clicking the delete button again and again. If you are a lazy person then probably you don't like to waste your time to find some stupid script to delete all nodes. In fact there is no need to do that, since somebody had already done that. I am saying about the Devel Generate module. Yes, Devel Generate to delete nodes!
Zyxware default image1
| 3 min read
While trying to fix an issue with Drupal Views, I wanted to use a single custom table to store the char count of the body field of different content types instead of creating separate CCK fields for each content type to store the same. The question that came to my mind was how to integrate my custom database table with Drupal Views? Drupal's Views module provides a hook for doing this - hook_views_data().
Zyxware default image2
| 7 min read
The default behavior of drupal_redirect_form in Drupal 6 is to redirect the user to $_GET['q'] when an explicit redirect location is not set in $form_state['redirect']. So any form submission from a Drupal page with additional querystrings like in a paginated form (for example admin content listing forms or admin comment listing forms) will result in the querystrings being lost. This can be frustrating when you administer content from such forms as you have to click the pager link and go back to the previous page after form submission. This can easily be fixed by adding a submit handler for the form in question and setting form_state redirect correctly.
Zyxware default image3
| 4 min read
The default comment moderation system in Drupal 6 is crude at best primarily because of the limitation of the admin comment listings. The information that is shown by default are 'Subject', 'Author', 'Posted in', 'Time' and 'Operations'. Now the main objective of comment moderation is to reject spam comments. None of these fields give any information about whether the comment is a spam comment or not and you will have to view each comment by going to the edit view of the comment and then approve or reject the comment. This is a very laborious and frustrating process. You have three options to solve this problem and get a better comment administration interface - one is to create a comment view, another is to alter the default comment administration form and the third is of course a custom solution for comment administration.