Download & Extend

View Mode Tooltip

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 :

<?php
/**
* @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>

Downloads

Project Information


Maintainers for View Mode Tooltip

Issues for View Mode Tooltip

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports