• Resolved ankitavib

    (@ankitavib)


    Hi,
    I am using the free version of the plugin. To allow clickable links in the tooltip content, I am using ‘glossary_tooltip_html’ filter. It is working fine. But when I add bullet points, images, line breaks, etc in the glossary content it is not displayed inside the tooltip content (popup).

    Can you please guide how can I achieve this?

Viewing 11 replies - 1 through 11 (of 11 total)
  • I replied in the other ticket:

    That type of content is stripped/removed automatically.
    As we are generating an excerpt only few HTML tags are allowed in that content because sometimes they are broken and this will create troubles in all the page.
    If you don’t care of this with the same filter you can repalce the tooltip content with what you prefer.

    Thread Starter ankitavib

    (@ankitavib)

    I am using the same filter and replacing the content, but the ul tags, images etc are displaying in the page and not inside the tooltip popup.

    I need a page with the issue to understand what is happening and the code are you using for the filter as we are stripping the html tags in the excerpt and not after the tooltip execution.

    Thread Starter ankitavib

    (@ankitavib)

    Please check the link below:
    http://nat.verifinow.in/videos/bhagavad-gita-chapter-1/

    Here the highlighted text is the glossary terms. But for the second glossary term the bullets and other html is not getting displayed inside the tooltip content.

    Can you please help?

    I don’t see any tooltip in that page. It is enabled the link only mode so there isn’t a tooltip.
    Anyway I also need your code you used in the filter.

    Thread Starter ankitavib

    (@ankitavib)

    http://nat.verifinow.in/videos/bhagavad-gita-chapter-1/

    Please click on the text “Vedanta”, here you will find the tooltip. Similarly clicking on “Shloka” will also give you the tooltip. and this is where bullets are added.

    Below is the filter code:

    add_filter('glossary_tooltip_html','test_callback',99,5);
    function test_callback ($tooltip, $excerpt, $photo, $post_id, $noreadmore) {
    	$gl_post = get_post($post_id);
    	$tooltipHTML = '</span><span class="hidden glossary-tooltip-content clearfix"><span class="glossary-tooltip-text">' . $gl_post->post_content . '</span></span></span>';
    	return $tooltipHTML;
    }

    We strip those tags only on the excerpt generation and you are using the linktooltip mode so the filter should do something.
    Are you sure that the filter is executed? Because I don’t think so.
    Where did you put it?

    Thread Starter ankitavib

    (@ankitavib)

    Yes the filter is executed, but the bullets and line break dont work..they appear outside the tooltip. Filter code is in functions file

    • This reply was modified 2 years, 7 months ago by ankitavib.

    Outside the tooltip means that the html code you inserted is not right.
    Looking at html specification span cannot contain lists, now I remember better.
    Infact in the excerpt generation I added a code that replace lists with dots to replicate a similar behaviour: https://plugins.trac.wordpress.org/browser/glossary-by-codeat/tags/2.0.20/frontend/Core/Generate_Excerpt.php#L50

    I think that the issue you are facing is:

    * A tooltip that if it is long enough has a list
    * As you set not so many words/characters for the tooltip wasn’t showed
    * If there is a list in the excerpt it will appear like a lists but you never reached that stage

    SO you should try with a big number for the excerpt generation (and check if the article doesn’t have one) and remove the filter to see if the lists ffinally appear.

    Thread Starter ankitavib

    (@ankitavib)

    Not getting you. Can you please elaborate what exctly needs to be done?

    In the glossary settings at the end of the page there is a section that let you configure how many characters are included in the tooltip.
    You need to change that value and remove the filter. In this way the tooltip has more text inside of it and can include better lists if they are not at the top of the article itself.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to add bullets, line break, image etc in a tooltip content?’ is closed to new replies.