Created
November 16, 2012 10:55
-
-
Save iAugur/4086397 to your computer and use it in GitHub Desktop.
Drupal: Surface a block as a Display Suite Field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a custom module and implement hook_ds_fields_info to surface your 'field' to DS | |
* Create a custom theme function to create the content when called by DS | |
* | |
* | |
*/ | |
function yourmodule_ds_fields_info($entity_type) { | |
$fields = array( | |
'yourmodule_group' => array( | |
'title' => t('some desc Group'), | |
'field_type' => DS_FIELD_TYPE_THEME, | |
'properties' => array( | |
'formatters' => array( | |
'yourmodule_block' => t('Text'), | |
), | |
), | |
), | |
); | |
return array('node' => $fields); | |
} | |
function theme_yourmodule_block($variables) { | |
// do some fancy stuff here | |
$content = 'your field contents to return'; | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment