26
Aug, 2014
sivaji's picture

0 Comments | Submitted by sivaji

Although Webform module comes with limited integration to expose the submitted data in Views, it lacks the fine control to make View by Webform field as rows and columns. There is a workaround to achieve this though which I would like to briefly run through in this blog.

Webform MySQL Views together with Data and Schema modules with a patch to Webform MySQL Views from issue #889306: Allow the designation of a primary key for MySQL views makes this feasible.

Webform MySQL Views, as the name implies, allow us to create MySQL view from Drupal, leveraging the Data module which counts on Schema module.

Data module wraps a bundle of sub-modules, among them Data Search provides Views Integration and Data Admin UI for accessing its administrative pages.

Once the mentioned modules are enabled. You can see a sub-menu "MySQL Views" under Administration » Content » Webforms. Tick the Webform node whose fields are needed in Views. This form is only meant to create MySQL view.

Read more →

26
Aug, 2014
Pathirakaliappan's picture

0 Comments | Submitted by Pathirakaliappan

In a Drupal site, if we have any module upgrade or configuration related work to be done in our live site, it is recommended to put the site in maintenance mode, so we can prevent end users from experiencing glitches.
 
When the site is operating in maintenance mode, any page request would return only maintenance message. Some pages are allowed to access though. The login functionality for instance will work in the maintenance mode. Recently, I faced such a requirements in which a custom module's callback to be invoked as to let Single Sign On (SSO) work for admin in maintenance mode. I would like to explain the way I fixed the same in this blog.
 
There is a hook in Drupal 7 for that, hook_menu_site_status_alter(). With this hook we can control the site status before menu dispatching, So we can change the site status for the particular path.
 

Read more →

01
Aug, 2014
Pathirakaliappan's picture

0 Comments | Submitted by Pathirakaliappan

Contextual link is a nice addition made into Drupal 7 to favor usability. It offers, quick links to pages performing administrative operations. By default it is available for core block and node teaser view. But designed to be made extendable for other items too - Views, panels, and so.
 
Custom contextual link (aka ccl) module is the best choice for adding custom link items.
 
But I have faced some problems in ccl module while adding a custom contextual link for a block. I would like to share the problems and how I overcame the same.
 
ccl relies on hook_contextual_links_view_alter() which will only alter or add links if there is already a #contextual_links element in the renderable array. The main content block doesn't get the default Configure block contextual link (see _block_get_renderable_array()), and therefore ccl doesn't affect it by default. 
 
In my case I have added the block on a panel, So the ccl modules doesn't affect my block. So I had to find a workaround. Problem explained in detail below,
 
I needed to create a contextual link for my follow block (from Follow module). The destination of the link is admin/config/services/follow. Then we have to create a menu for contextual link with the path in hook_menu()
 

Read more →

01
Feb, 2014
sivaji's picture

3 Comments | Submitted by sivaji

WYSIWYG (a.k.a HTML Editor) has become a De facto for quickly formatting and publishing contents from dynamic site like Drupal. This is certainly a time saver and prevents from getting hands dirty with HTML.

In this connection, CKEditor has been a pioneer and around in use and development cycle for a decade (first release was on March 2003, in the name FCKeditor).

This solid and interesting tool plays good with Drupal content publishing system via Wysiwyg module. The recent CKEditor, version 4.2.x brings something more interesting to our desk. I'm talking about Templates plugin in specific.

Note: As of now this version of CKEditor requires dev version 2.x-dev of Wysiwyg contrib module.

Our project requirements were to create a Newsletters sending site with Drupal as base. (Having admired by Mailchimp, I considered this project as a trimmed version of the same).

Essentially we put together contrib modules - Simplenews, Mandrill, Wysiwyg (with CKEditor), Mime Mail and Media to get started. 

Read more →

24
Jan, 2014
Ganesan's picture

2 Comments | Submitted by Ganesan

Page.tpl.php:

  • Template file to display a page's output in Drupal
  • This file contains a combination of php and html tags
  • To render the content, we need to use the PHP variables. For list of available variables, see handbook page

hook_preprocess_HOOK():

  • Simply called as a preprocess function, defined in template.php of active theme
  • Essentially used to add/alter variables before they are rendered in the template file
  • To use, replace "hook" with module or theme name and "HOOK" with 'page','html' or 'block' as needed
  • In your case, this will be "my_theme_preprocess_page" since page template should be altered

Creating separate page.tpl.php:

Let come to the heart of the topic, by reading the above explanations you would have obtained a pinch of salt about the real scope in using page.tpl.php and hook_preprocess_HOOK.

Now do the following:

In active theme's template.php file add the below hook_preprocess_page() implementation,

Read more →

Subscribe to RSS - Drupal 7