Skip to main content
5 votes

How do I create a custom plugin?

There are no ctools plugins anymore in Drupal 8. There's just the Drupal 8 plugin API. Page Manager, Panels and so on use standard block plugins now in 8.x, so you basically have to port this to a ...
Berdir's user avatar
  • 83.3k
3 votes
Accepted

Custom block: How to know you're in an admin context?

Looks like I just need to call path_is_admin if (!path_is_admin(current_path())) { drupal_not_found(); drupal_exit(); // This is needed if we call drupal_not_found() from hook_block_view() }
Beebee's user avatar
  • 6,876
2 votes

ctools module keeps getting unloaded?

ctools_get_plugins() isn't a function defined in a module file, but in the includes/plugin.inc file in the directory containing the Chaos tools module. It's not the module that isn't loaded. It's the ...
apaderno's user avatar
  • 97.5k
1 vote

Create a modal popup

You should use the ctools_modal_text_button function to render your "popup-opener" links. ctools_include('ajax'); ctools_include('modal'); ctools_modal_add_js(); $link = ctools_modal_text_button('...
milkovsky's user avatar
  • 5,344
1 vote
Accepted

Composer error with Ctools package

Try taking off the "8". "3.0-beta1" works for me. They have started changing the format of the versions by removing the "8" for some reason. Not all the projects have changed yet.
heart.cooks.mind's user avatar
1 vote
Accepted

Add ctools processing for content loaded via ajax

You need to call Drupal.attachBehaviors() after inserting the new content into the page. Change this: $parent.append( data ); To this: $parent.append( data ); Drupal.attachBehaviors($parent);
Jaypan's user avatar
  • 17.6k
1 vote
Accepted

How to add a modal which then opens a ctools modal?

Any pointers as to where I can find a workable solution to this? If you know jQuery and CSS you can create your own custom modal. Modal one has div id of modal-1 and for two modal-2. use the z-...
No Sssweat's user avatar
  • 31.4k
1 vote
Accepted

Programmatically rendering a Views pane with arguments from context

I got it to work with $selected_type = 'views_panes'; $selected_subtype = 'persona_display-panel_pane_1'; $context = array( 'context_taxonomy_term_1' => ctools_context_create('entity:...
Pierre Buyle's user avatar
  • 11.4k
1 vote
Accepted

How to set #value to the form item from HTML data-*?

I solved this task with Drupal.behaviors in js-file like that: Drupal.behaviors.mymodule = { attach: function (context, settings) { var paint_id = new Number($('.paint-order').data('pid')...
Alexey Dyomin's user avatar
1 vote

What is wrong with my render code?

You cannot run any code after a return statement. By definition the return will exit the function. Try moving the dpm call to just before the return statement. As an aside, I believe that best ...
bleen's user avatar
  • 1,500
1 vote
Accepted

View using views content pane not updating on node save

Take a look at the Views content cache module. It allows you to expire the views cache on add/edit/delete of nodes in your view. Also, be sure to look at the Panels caching on your home page, ...
thejimbirch's user avatar
1 vote

How to add comment to a node with ajax (ctools modal)?

You need to add ajax library to that drupal_add_library('system', 'drupal.ajax'); Or you can use the below function to render the ajax link $block['content'] = l(t('Add a review'), "add/nojs/...
NTT's user avatar
  • 1,389
1 vote

.attr('target','_blank'); does not work

This questions seems unrelated to Drupal, and is probably more appropriate on a different forum. I'm no expert on HTML, but you should make sure that: (a) you are applying the target attribute to ...
argiepiano's user avatar
  • 2,082
1 vote

show a form in a popup when a button is pressed

Another solution is to use Ctools Automodal module. This approach is less complicated to @Web-Beest answer. Here is the example on how to use it. function mymodule_menu() { $items['mymodule/form'] ...
Gulok's user avatar
  • 898
1 vote
Accepted

Ctools Multi step form throws error when form_validate is from another file

Figured it out, we need to include using the below function form_load_include($form_state, 'inc', 'module_name', 'module_name.file');
NTT's user avatar
  • 1,389
1 vote
Accepted

How can I display a login and registration form, with an extra field on registration, and hybridauth in a modal?

Yes, this has a common solution with preexisting modules. Here's the summary with your 3 requirements: Forcing capture of telephone on registration: After enabling the Telephone module, you can add ...
Shawn Conn's user avatar
  • 26.9k
1 vote
Accepted

Unable to override ctools selection plugin class from my module

same problem, two days wasted according to http://lookalive.co.uk/blog/drupal-entity-reference-how-make-custom-entity-reference-selection-handler and all it's copies. ...
Mykola Mykolayovich Dolynskyi's user avatar
1 vote

Page Manager on a variant of the node url

I don't know if this is the only way to do it but I just add custom pages at /admin/structure/pages like: /node/%node/admin I guess there are some benefits to doing it separately instead of as a ...
Niall Murphy's user avatar
  • 2,771
1 vote
Accepted

How to get Page Manager to react on path alias before node/%node

If you want to override the default path like node/%node, taxonomy/term/%taxonomy_term and so on then there is a module for that: Page manager existing pages. Some more details about this module (from ...
graceman9's user avatar
  • 672
1 vote

Collapsible Search Bar

If I understood you correctly: You have exposed filter in block, which have for example two fields, search by title and checkboxes. So you can use: https://www.drupal.org/project/...
OnengLar's user avatar
  • 203
1 vote

How to redirect to another page after submitting the ctools modal form

@Hitesh Jain : Thank you for the answer. Your comment helped me. Just adding this as an answer so that it can help others. ctools_include('ajax'); ctools_add_js('ajax-responder'); $commands[] = ...
akshata's user avatar
  • 21

Only top scored, non community-wiki answers of a minimum length are eligible