Using ctools content as a field with Display Suite in Field UI

Display Suite has the ability to create custom fields, either through code or via the UI. Those fields can hold custom content or even PHP code. It is somewhat limited since one field can only have one type of content, unless your field has some crazy PHP code which is not easy to maintain. Those days are over now. You want to add custom content, a node, the logo or any other type on the Field UI screens? The upcoming release - 7.x-1.2 - comes with a new field called ctools field, which can hold any sort of content that is available through ctools' plugin system and which is configurable on the "Manage display" screens per entity, bundle and view mode. Think as of Panels, but in Field UI. And they are of course all exportable. This may all sound a bit cryptic to you, so I've recorded a screencast showing you how this works. Be amazed and watch out for the upcoming release of Display Suite somewhere next week!

Comments

Submitted by frega on May 23, 2011 - 11:31

hej swentel,

great stuff yet again! Very excited about you mentioning ctools-contexts being introduced in the DS-world! That's the one place where the fields-ui-centricity of DS breaks down somewhat so far (at least if you don't custom code); ctools' page manager's (or panels') ability to resolve contexts and relationships between entities are the best-of-breed so far in drupal - great that it seems possible to leverage that.

Best, Fredrik

BTW: i did a proof-of-concept module for "the other end" of the "ctools-ds integration"-spectrum, integrating DS in to Page manager :) A small module (pm_viewmode) consisting of a simplistic task_handler plugin that renders a entity in a custom view mode (with or without a title):

/custom-view-mode/%node -> render node in a custom view mode

Additionally a viewmode-argument-plugin allows for dynamic view mode selection:

/dynamic-view-mode/%node/%viewmode -> render node in a view mode based on path-arguments

Code's here: http://drupal.org/sandbox/frega/1141112

Submitted by swentel on May 23, 2011 - 11:54

The plugin sounds cool, although I'm missing the link with just adding a node content into a pane. But then again, it's the first time I'm really digging CTools on a deeper level about this sort of stuff. The only thing I can say is, the possibilities are endless :)

Submitted by frega on May 23, 2011 - 12:20

Hi, sure you can do that, but you *don't need panels at all* for pm_viewmode (only page_manager). Not that panels is bad, but if you just want to render a node in a different view mode under a different path that's overkill to me; and even adding a node body into a pane can be confusing to a noobish site builder - if DS has "proper" ctools integration (w/ contexts and relationships), that would suffice for many use-cases :)
best, fredrik

You are here