Every small finding is worth sharing. This blog post is no except for this fact. Drupal ships with a module for blogging since a long time. This mighty module offers a potential multi-user blogging feature to Drupal site. This is an essential module for most of the contents publishing site. Blog content has been architectured to leverage node. A new blog can be created by any user with permission "Blog entry: Create new content" as of Drupal 7.
HTML 5 has been encompassed with many novel attributes, one of which is the Placeholders. The Placeholder attribute displays text in the input field till it is focused and then hides the text on click. These Placeholders plays an momentous role in offering a visual information about the field. A general place where I prefer to add Placeholders is template.php in your theme.
Rules no novel to Drupal area, are always considered as the unsophisticated way to accomplish action. A paradigm of rule's dominance can be witnessed in sending a mail after a user account creation, Blocking a Specific user from accessing the site, Providing access to products in Drupal Commerce, etc. Rules can be created either programmatically or by using piece of code.
At KnackForge we often see requirement to expose custom fields to views for better integration with Drupal flow. In this article we are going to see steps to expose a custom field from a custom table. Infact its a virtual field.
Assume you have two custom fields total_marks and marks_obtained in a custom table. Now you need to calculate the percentage of mark scored. You don't need a field in table for this. You can create a virtual field bound to marks_obtained field.
Recently I had the need to display the currently logged in user's name in the main menu region. The requirement was so simple, for non-logged in users the site should just show the main menu, but for logged in users it must display their name as the first item in the main menu.
Pager: no new to the dictionary of Web, plays an important role in reducing long scrolling and improvises the visual look of the site. One of the pages in my site lists statistics based details. It wasn't that appealing to go ahead with this page which had almost 100 plus items to display. At this point I had a sudden idea to split the statistics with the help of pager.
Search plays a crucial role in content driven websites. Drupal and the Open source enterprise search platform Solr form a effective combination. Drupal 7 has apachesolr module which integrates Drupal with the Apache Solr search platform. I am going to detail on how to alter the solr query to get better and precise results.
One of the Drupal sites we did recently had a requirement to set browser tab (or window) title from Drupal menu. Usually it will be h1 title of the web page in Drupal that will be shown as tab title. Even the modules like page_title module doesn't seem to have any configuration for our case. But there is always some APIs and hooks to rescue the developer. For our case, the following eight line snippet did the trick,
Lightbox a powerful module in Drupal arena., proved its mastery once again! I was involved in trying to find a way to display nodes in popup, the apparent module that struck my way was Colorbox-Node. Things looked as if it would be a cake-walk but went beyond what I thought. The Colorbox-Node holds the ability to display nodes in overlay effect, but it needs huge template and jQuery level customization.
At many times Drupal Architects prefer to go with Apache Solr instead of Drupal core search. I am no outlander to this scenario, but this time it was a new requirement. By default the Apache Solr relies on Jetty server to index and retrive items during the search. My need was to use Tomcat server in the place of Jetty. The first glance proved it was an easy task, but latter the tough fight started.