View Mode Tooltip
Component ID
1340080
Component name
View Mode Tooltip
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Downloads
379
Component created
Component changed
Component body
This module let's you use an entity view mode as a tooltip. By default it works with fields of type "text".
If you have the Display Suite module installed, you will see a "Title (View mode tooltip)" field as an example.
I want to use it in my module
The module also comes with a theme function you can use. Example :
/**
* @param $element
* the element to use the tooltip on eg. simple text like t('Your text')
*
* @param entity_type
* the entity_type eg. node, user
*
* @param entity
* the entity
*
* @param view_mode
* the view mode eg. full, teaser
*/
theme('view_mode_tooltip', array(
'element' => t('Hover to see the tooltip'),
'entity_type' => 'node',
'entity' => node_load(1),
'view_mode' => 'teaser',
));
I want to customise the tooltip output
Here's the tooltip output HTML :
<div class="view-mode-tooltip">
<div class="tooltip">
<div class="tooltip-content">
<?php print $tooltip; ?>
</div>
<div class="tooltip-arrow-wrap">
<div class="tooltip-arrow"></div>
</div>
</div>
<div class="element">
<?php print $element; ?>
</div>
</div>
