Custom Fields
Re-Envisioned
Support General Tooltip Display Content

  • Creator
    Topic
  • #21351
    Resolved @mindspark
    Participant

    Hi Metabox!

    Right now, when I add a tooltip attribute to a field, the text is displayed as expected. But I would like to add an image or a video URL in the tooltip.

    Is there a way to override the field display properties? I think it is set to only accept text characters… but what about HTML?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #21354
    @mindspark
    Participant

    I figured it out! For others looking for the answer, see below:

    In order to allow a tooltip to accept HTML, do this –

    1. Go to Custom Attributes and create a new Tooltip

    Field > Custom Attributes

    Key = tooltip
    Value = Tooltip text. <add your HTML>

    1. Then add a new custom attribute below the first tooltip attribute like this

    Key = allow_html
    Value = true

    By adding the second attribute for “allow_html = true” then Tooltips will now accept HTML.

    #21355
    Long Nguyen
    Moderator

    Hi,

    The extension Meta Box Tooltip v1.1.3 supports to show the HTML code in the content.

    array(
        'id' => 'name',
        'type' => 'text',
        'name' => 'Name',
        'tooltip' => array(
            'icon'     => 'help',
            'content'  => '<img src="https://homepages.cae.wisc.edu/~ece533/images/airplane.png" alt="image alt" width="100px" height="100px">',
            'position' => 'top',
        ),
    ),

    For more information, please follow this documentation https://docs.metabox.io/extensions/meta-box-tooltip/.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.