Drupal Ctools
more_horiz
close

on 31st March 2014 / by sreelal.mu
Panels in drupal is a very usefull feature for displaying the contents in a well organized manner. The site administrator will have full control over the panels.Creating panels via User interface is not a complex task. But there may arise situation when you need to create this via code. This article explains how to achieve this via code. Creating a custom content pane using the ctools content type. Step 1) In the custom module implement the hook_ctools_plugin_directory , to know where the ctools plugin is actually stored For eg : A custom_module {sites/all/modules/custom/custom_module/custom_module.module} file should implement hook_ctools_plugin_directory() function custom_module_ctools_plugin_directory($module, $plugin) { if ($module == 'ctools') { return 'plugins/' . $plugin; } } This is to let the system know we implement plugins. This will search for the content types in the directory plugins/content_types Step 2) Create a directory named plugins in the custom module {sites/all/modules/custom/custom_module/plugins) Step 3) Create a sub directory content_types in the plugins directory {sites/all/modules/custom/custom_module/plugins/content_types} Step 4) Next is to create a content type. Create a file with extension .inc for eg : example_pane.inc ie, content_type_name.inc. This is the content type. Each content type must have unique name , so it is better to name the module name as the content type itself if our module has only one ctools plugin content type. Step 5) In the file example_pane.inc we can write the call back function to supply the list of the content types. ie, the Implementation of MODULENAME_FILENAME_content_type_ctools_content_types Here is an example : function custom_module_example_pane_ctools_content_types() { return array( 'single' => TRUE, 'title' => t('Example Custom Content Pane'), 'description' => t('Example Desctiption'), 'category' => t('Example Category'), ); } Here category defines where our content type shows up in the "add content" dialog. If it is not previously defined ctools will create a new one. Step 6) Next is the Implementation of MODULENAME_FILENAME_content_type_render Eg : function custom_module_example_pane_content_type_render($subtype, $conf, $panel_args, $context) { $block = new stdClass(); $block->title = 'Example Title'; $block->content = 'Example Content'; return $block; } This function will return the content that is to be displayed in the panel. Happy Coding. Drupal Drupal 6 Drupal Ctools Drupal Panels Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 30th October 2012 / by webmaster
"CTools CSS Cache. Unable to create The CTools CSS cache directory, ctools/css could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories." If you are getting this error message while inspecting the status reports on your Drupal site then continue reading to get the solution. This error message occurs because you need to make sure that the files directory (sites/default/files/ctools) is writable by the webserver. Since this is a server issue the fix varies from setup to setup however the logic is the same. Here is a generic version of the solution. Firstly check you file system path Check if it is in the format "sites/default/files" If it is then go to the files directory and assign 777 permission to sites/default/files/ctools Next run CRON and then check the status reports. If the error message persists simply create files/ctools/css and assign it a permission of 777. Hope that helps. The easiest way to solve a Drupal issue is to hand it to the Drupal experts. We can provide a wide range of Drupal services to help you maintain and manage your Drupal websites. Get in touch with us to know more. Reference: http://drupal.org/node/1236770 Drupal Drupal Issues Drupal Ctools Leave a reply Your email address will not be published. Required fields are marker * Anonymous (not verified) access_time 27 May 2019 - 12:33 Following post asks to run chown command. I don¨t have SSH access so dont know how to run it.http://theaccidentalcoder.com/content/drupal-and-permissions-avoiding-d… loneranger (not verified) access_time 27 May 2019 - 12:33 Hello there, I found your site today after searching for a solution on ctools access denied issue on my drupal backup site after an silly problem on the drupal7 language changes to the earlier site. First of all, I would like to thank you'll for your precise/accurate answers to questions/problems on yout Site! I'm having problem of accessing my site after changing the language. It is deafault drupal german installation but after installation I use it for english language. It worked for a long time untill I changed the language again! I hope, You'll understand the spesific situation here what I'm explaining. At the moment I'm runing an 21 days old backup as my site again! If there is an solutin for this, please kindly let me know it. Best Regards, Anonymous (not verified) access_time 27 May 2019 - 12:33 I cannot change the permissions of files/ctools/css "550 Could not change perms on css: Operation not permitted" Anonymous (not verified) access_time 27 May 2019 - 12:33 I use a Linux distro so just went into: sites/default/files/ Then create the directly: sudo mkdir ctools and then gave ownership to my web server (www-data): sudo chown www-data:www-data ctools Then I reloaded the Status Report page in Drupal and the error message had gone. Thanks webmaster! Add new comment