Technical Solution
| 2
min read
We needed to get the description of a site automatically from its url after parsing the HTML markup, for one of the Drupal sites we were working on. This is a task that can be easily accomplished by using the PHP curl library. Read on to know how to use a php script and curl to download the contents of a website.
Drupal Technical
| 3
min read
In Drupal we have got a module namely Registration with Profile , to bring an option to upload the profile picture. But here let us gather some information on how this can be brought programmatically.
So let's start up with Form API.
Following are the steps to get the profile picture uploading option in registration form.
Step 1 : In registration form alter :
Drupal Technical
| 2
min read
Comment module in Drupal makes it possible for users to comment on the nodes we create. And also the users get a chance to discuss on the topic as well. In this article I try to demonstrate how the comments for a node can be wrapped inside a fieldset. Isn't it a good choice? If you haven't done it, now will be a good time to do so.
Drupal Technical
| 2
min read
Hey, are you the admin of your site? Do you want to get the total number of words of your node on double click? Well then, here is an article on how to get the word count of your nodes at your mouse tip in a few simple steps.
Drupal Technical
| 2
min read
Getting a block in front page or in all other pages is easy ie, we only need to print that variable in our template files namely page-front.tpl.php or in page.tpl.php.In certain cases we may need to print a block in certain nodes. This can be done by the following code :
Drupal Technical
| 3
min read
Every one will be familiar with the template files.Now lets see the case to theme a block. Here we can use block.tpl.php for theming the block but what if we want to theme the block specifically by a region?In one of my recent projects I need to theme the block in a specific region, I cannot use block.tpl.php as this may cause all other blocks to change.While digging a bit deeper I found out that this can be done easily by using a template for that particular region.Let's see how it can be done so.
Drupal Technical
| 3
min read
Getting search fields inside a view is easy that is adding a field in 'Filter :Criteria' and exposing it, so we get the search field and now you can search based on that field.And when we require more than one field to be searched we need to include it by adding the fields in 'Filter Criteria' and exposing it , which looks weird when we have 3 fields in a single search form.So what if we have an option to make it a single field say we have to search the contents based on 3 fields with a single search field.Isn't that interesting?Here comes the use of 'Finder' module which is safe and sound.
Drupal Technical
| 3
min read
As Drupal sites are becoming increasingly flexible, it is obvious to list the nodes related to logged in user. This can be done with the help of PHP and MYSQL codes. However, we need not waste time if have the views module - the perfect icing on the cake !!! So, let's narrow down here.
Drupal Technical
| 2
min read
In Drupal, while adding a menu item, we can give it a title, description, path and such details. It is not possible to give images for these menu items at the time of creation, by default. If you are looking for a solution, then read on.
This particular task can be achieved by overriding the theme function theme_menu_item_link() in our theme's template.php
Use the below function in your template.php :
Drupal Technical
| 2
min read
Forgetting a password is a usual scenario. The first thing that may come to your mind when you forget the password of your site is resetting it. If it is a live site, then we can ask to send a new password by mail. But what is if it is your local site where no mails are configured? well, I know a trick or two to solve this programatically. If you too want to know, then read on.
Step 1 : Create a new file and copy the below script in that.