A few Drupal users had found out that their site Contact form does not load in Colorbox when calling it with the relative page url. If you are facing the same issue with Colorbox in your Drupal site the continue reading.
Here is the most probable solution.
Technical Blog
This article will be explaining how to create custom block and how to add the custom block in to quick tabs, programmatically. If you want to display the block inside a node you can refer our artilce How to print a block inside a node on a Drupal 6 website.
First lets create a custom block using hook_block. In this block what I want to display is when we provide a url, need to display corresponding alexa graph for the particular site.
One of our Drupal clients requested us for a feature in a mobile version of their Drupal website in which, a user accessing the mobile version of their website, should be able to automatically initiate a call on clicking the telephone number appearing in the website. If you want to know "How to start a call when a user clicks on a number in a mobile version of a Drupal website, then continue reading.
While working on Drupal Views, we might want to examine the query executed by the View to get its data. Analyzing the query may help us to identify why the view does not produce expected result. Read on to know how to view the SQL query executed by a View.
In Drupal, while viewing a content type it will display the content type view with a comment form. If we want to remove the comment form from the view node page we can disable/unset it using hook_node_view function. But what we have to do if we want the comment form in a separate tab.
There is a module called Talk. This module removes the comment form from a node view page and display it on a separate tab.
In a recent project, one of the client requirements was to remove the link of the cart-image which appears in shopping cart page. In drupal, when a node is added to cart, it will be automatically linked to the corresponding node page. He wanted to hide it because, we were not using the default node page for the products. If you want to know, how we removed the link from the cart-image, you may follow the stepss below.
In a recent project, I had to make use of pagers in two views. As per the requirement, I had to display different numbers of contents per page for both views. For the first view, I had to display 2 items per page and for the second one(search-results view) 10 per page.The problem I faced was, Eventhough if I had less than 10 search results, the page displayed the pager-links as per the contents of the first view. ie, both the views showed same number of pagers, which was wrong. If you want to know, how I fixed this, please read on.
Views Bulk Operation module is helpful in the cases where we need to perform a particular operation for more than one row in a view. Some of the operations includes deleting multiple contents, publishing/un-publishing contents, change the author of the content, send email etc (Refer the image below). These are the default operations available with the module. Now, what if you need some of your operation to be performed other than this? That too is possible. You may read on if you want to know how it can be done.
You may be familiar with the theme information link in views. The theme information link in view tells us which files are to be modified, to theme the view. You could get more information regarding the view from, http://viewshelp.doc.logrus.com/help/views/analyze-theme. This is the case where we have a theme with us. But what if you don't have a theme and you still want to theme the view's result? Well, read on if you want to find out how to theme a view by adding a template file inside your custom module.
Recently PayPal changed their policies and creating a sandbox account was a bit confusing for me, when I wanted to test my ubercart site. However, I created one and thought of writing about it in case some one needs it. So, here it goes.
One of our client's site, which runs on Drupal 7 allows users to create envelopes based on the custom values like name, address etc submitted by the user through that Drupal website. The requirement was to load this envelope in ckeditor so that end user can edit the default values given as per their wish. So we had to load the form field with the default values given in template. We used jQuery to do this. If you are looking to know how to load a drupal 7 form field with default values from CKEDITOR body content, then read on.
Most of us know how to send an e-mail with attachment. But do you know how you can do this using drupal 7? Not sure, then read on.
In this article, I am going to address 2 isssues.
Sending an e-mail with an attachment.
Sending an e-mail with multiple attachments.
Sending an e-mail in Drupal 7 with an attachment
The steps to be followed are:
Step 1: Install and enable the modules MIME mail and Mail system.
Step 2: Define hook_mail() in your custom module.
The synatx is as follows:
Why do we use CK-Editor? Well, obviously to create customizable contents, right? If you are creating a page, you can change the heading style, color, font-size, font-style etc with the help of CK-Editor. Well,I don't know if you could create your custom color or font-size, but changing default fonts of ckeditor is definitely possible. For that you may follow the below steps:
Step 1 : Create a css that contains the path to the fonts.
Whenever you need to create a contact/feedback form in drupal, everyone will be thinking of using "Webform" module. Using webforms to do so, is a good choice. Normally, the forms created using webform module are displayed as pages. There may be certain situations, where you need to display these as "blocks". If you need to know how to display webform as a block, read on.
If you have a webform with you, that you have already created, by adding the required fields, then follow the below steps:
If you want to switch among contents or nodes in Drupal 7 website, you can do this by adding navigation links(PREV and NEXT) to that particular content. This will help you to see contents without going to any other link. There are contributed modules in Drupal for this but if you want to know how this can be created programmatically, read on.
When we were working on a Drupal website using Ubercart, we wanted to override the text content of the default email sent out by Ubercart. Drupal does not give us a configurational method to implement this. If you do not know how to override the default email sent out by Ubercart during checkout, continue reading.
Ubercart stores the default content for email in template files. These templates can be found inside the ubercart/uc_orders/templates folder. Ubercart uses three template files.
If you are working on a Drupal website with Ubercart and if you are handling custom product mechanisms programmatically, one of the main task you may come across can be, 'removing an item from your cart', when a particular condition is satisfied. If you are facing any difficulty with removing items from cart, I may have a solution for you.
By default Ubercart provides custom function named uc_cart_remove_item() to remove an item.
uc_cart_remove_item(node_id, cart_id, product_data)As you can see that the function requires three parameters:
Many a times Drupal users face the problem of not being able to access the php variables in jquery function . One way of accessing this variables is using ajax but this causes time delay in sending requests.This time delay can be minimized using drupal.settings.If you are not sure how to tackle this problem then read on.
To add a video file inside the drupal site, there are different ways. If we are entering a video file inside the drupal site by entering the url inside a text field, and we need to find the url entered is of which type (ie the url is of youtube or vimeo type).
Sometimes we may want to find all unused contributed modules in our site to clean up and all. In that case instead of manually checking all the modules from the sites/all/modules folder we can take it from the database system table.
We may want to find these unused contributed modules list to physically remove them from the sites/all/modules folder. But before removing them we have to make sure that none of its sub modules are currently using. So in order to find out the unused modules list we can do the following three steps.