Skip to main content

Posts

Showing posts with the label Drupal

Difference between webform vs entityform in Drupal 7

Drupal has a lot of modules aimed at helping site builders and users add forms to their sites. What follows is a rough comparison of 2 of them. If there are any I've missed, please add them. Webform Webform is a module designed to allow you to add custom forms to the front-end of your site. Each form is stored against a node, so you add new forms to your site as if you were adding content. It's useful for things like Survey websites or just where you want a couple of forms that differ from the standard contact form. Pros Webform has been around for a long time, its very well established and has a large number of modules that  integrate with it . Webform can make a wide variety of forms with lots of different elements available out of the box. Because Webforms are nodes, they inherit all the functionality that nodes have (scheduled publishing, cloning, access control, etc.). Webforms are lighter-weight and more scalable than entity-based forms. Can handle multiple-p...

Drupal 7 Menu Link update through update.php

This is for hook_update_N function If we have a default menu, use below code in install file. /**  * Implements hook_update_N to create menu reports.  */ function mymodule_update_7120 ( ) {   $menus = array (     'menu_name' => 'my_parent_menu',     ' title ' => 'My parent menu title',     ' description ' => 'My parent menu description',   );   $links = array (     'link_title' => 'My menu link title',     'link_path' => 'custom_path_for_menu_link',     'menu_name' => 'my_parent_menu',     ' weight ' => 0,     ' expanded ' => 0,   );   // Save menu group into menu_custom table   // Look the table first if the data does exist   $exists = db_query ( "SELECT title FROM {menu_custom} WHERE menu_name= : menu_name", array ( ' : menu_name' => $menus [ 'menu_name']) ) -> fetchField ( );   // Save the rec...

CKFinder Installation in the CKEditor for Drupal 7 Module

Please follow the steps below;  Go to http://ckfinder.com/download and download CKfinder Unpack the contents of the installation package into the directory that contains the CKEditor module and place it in thesites/all/modules/ckeditor/ckfinder (or sites/all/libraries/ckfinder) folder. . When the files are unpacked, you should see the following file structure inside the drupal/sites/all/modules directory: Now open the CKFinder configuration file (ckfinder/config.php) and introduce the code changes described below. Firstly, remove the CheckAuthentication() function (do not worry, this function is defined in filemanager.config.php, see below): function CheckAuthentication()       <- remove it {                                    <- remove it    //WARNING : DO NOT simply...      <- remove it    ...        ...

Files that Drupal Themes Use

A drupal theme is a collection of files that define the presentation layer. You can also create one or more "sub-themes" or variations on a drupal theme. Only the .info file is required, but most themes and sub-themes will use other files as well. The following diagram illustrates the files that are found in a typical drupal theme and sub-theme. Drupal 6: Drupal 7: .info   (required) All that is required for Drupal to see your theme is a ".info" file. Should the theme require them, meta data, style sheets ,  JavaScripts ,  block regions  and more can be defined here. Everything else is optional in drupal theme. The internal name of the theme is also derived from this file. For example, if it is named "drop.info", then Drupal will see the name of the theme as "drop".  Drupal 5 and below used the name of the enclosing folder of the theme. Info files for themes are new in Drupal 6. In version 5, .info files were used solely for dru...

Drupal 7 admin pages slow

So for some time I've been running Drupal 7 for my private webpage. It has been slow as hell on the admin pages. The "frontend" side works fast and without any slowdown. There are  others experiencing the same trouble . A lot of others it seems. For years I've been running Drupal now and it's only since I switched to version 7 that it started to have speed problems. It has a major slowdown on all admin pages. They take sometimes 30+ seconds to load and almost every admin page uses 10+ seconds. The high times cause PHP to throw an error (Maximum execution time of 30 seconds exceeded) that some function was running too long. I constantly got these errors on admin pages. It was barely usable. I had to reload pages multiple times (often 5+ times) to finally get them to show. Each time I had to wait till the timeout came. Furthermore the update.php page had the same problem. I couldn't update more than 2 modules for some time. Now I updated to ver...

Smart pagination or page break in Drupal(wysiwyg)

1)Install Smart Paging module   Go to Administration › Configuration › Administer Smart Paging settings.   Under 'Default page break method', select "Manual placement of page break placeholder". 2)Install "wysiwyg" module and 'ckeditor' profile   Go to Administration › Configuration > Wysiwyg profiles > Filtered HTML   Edit the settings of Filtered HTML Profile. Under 'Buttons and plugins' section, check the required options like "Smart Paging ","Image","Bold". 3)Edit the configuration settings of input formats(Filtered HTML, Full HTML, Plain Text)   Go to Administration › Configuration > Text formats. Edit the required input format. For example say "Filtered HTML". Under  "Enabled filters" section, check the 'Smart Paging' option and uncheck all the remaining checkboxes. 4)Go to Content type 'article' and create new content. We will see the wy...