0

Is it possible to call custom code from a panel? My custom module has a function which returns some content. I wish to call this from my panel.

0

Here's a hackier/quicker solution.

Create a custom content pane using the PHP input format for the content area. Call your function.

You will not have simple access to panels contexts (which you may not need anyway), and must have the PHP input format enabled (which can potentially cause security problems).

You have access to the args, etc so you can pull nid from arg(1) if it's a node panel for example.

2

It is, but requires a bit of coding. You need to create a ctools content type plugin. I had the same issue a few months back, and found this to be a reasonably good guide for writing you r own content type:

http://shellmultimedia.com/articles/creating-content-type-ctools-panels-3

There are also a couple other options:

  1. Expose the data your function is providing in a block. Blocks are automatically supported by panels.

  2. You could (likely) use custom PHP in a panels pane. (highly discouraged)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.