Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Daniele Scasciafratte

    (@mte90)

    Hi,
    we clean the tooltip content because the HTML can be broken as can be truncated.
    With https://docs.codeat.co/glossary/developer/#interact-with-the-tooltips-html it is possible to alter the tooltip content with a PHP filter.

    Thread Starter Thorsten Hoeppner

    (@welliathome)

    I know that, but I haven’t been able to figure out how to get the content with tags using the filter.
    The example code makes no recognizable difference.

    Plugin Author Daniele Scasciafratte

    (@mte90)

    Well that php snippet to be adapted for your needs.

    If you want that is the original post content you need to do that:

    add_filter( 'glossary_tooltip_html', function( $tooltip, $excerpt, $photo, $post_id, $noreadmore ) {
        return get_the_content($post_id);
    }, 10, 5 );
    Thread Starter Thorsten Hoeppner

    (@welliathome)


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

    Unfortunately, something still seems to be missing for it to be recognized as a tooltip.

    Thread Starter Thorsten Hoeppner

    (@welliathome)

    add_filter( 'glossary_tooltip_html', function( $tooltip, $excerpt, $photo, $post_id, $noreadmore ) {
    $HTML = get_the_content($post_id);
    return str_replace(strip_tags($HTML), $HTML, $tooltip);
    }, 10, 5 );

    Unfortunately, that doesn’t work either.

    Plugin Author Daniele Scasciafratte

    (@mte90)

    This snippet is just the tooltip content so you don’t need the span and so on as wrappers.

    Also what means does not work?
    You don’t see the content changing in the tooltip?
    Do you have a cache system to purge?

    I need more details like a link with the issue.

    Thread Starter Thorsten Hoeppner

    (@welliathome)

    Instead of the tooltip, the text of the page is inserted again.

    https://photos.google.com/u/0/photo/AF1QipOT3uSE-aKqDeBWIXUdQuEsAEV9y4oGwujTtu1a?hl=de

    Plugin Author Daniele Scasciafratte

    (@mte90)

    The link requires an email.
    With the “text of the page” what do you mean?

    Thread Starter Thorsten Hoeppner

    (@welliathome)

    This is a [Test] 

    This is a test for the tooltips.

    for the tooltips.

    [Test] is the word with the Tooltip.

    Plugin Author Daniele Scasciafratte

    (@mte90)

    So our plugin finds a term in the page, inject a tooltip with the content extracted and parsed from the term itself (not from the page where the term is found).

    The filter I shared just let to replace the tooltip content the plugin generate with something else.

    It is not clear to me if the tooltip content generated to you is right or not, with that I mean that is just the post type content and not stuff from the theme (I am still not able to see the link you shared).
    Next step if the code you inserted works (where did you inserted?), if your site has a cache and so on.

    With premium support is more simple as I get access to the website in our premium ticket platform.
    So I need more clear information as with free support is more difficult to understand what is happening.

    Thread Starter Thorsten Hoeppner

    (@welliathome)

    Since it doesn’t seem to work with original HTML, I’m now using a different approach:

    [Test]:|This is a tooltip as a test.
    add_filter( 'glossary_tooltip_html', function( $tooltip, $excerpt, $photo, $post_id, $noreadmore ) {
    $HTML = str_replace("|","<br>",$tooltip);
    $HTML = str_replace("[","<b>",$HTML);
    $HTML = str_replace("]","</b>",$HTML);
    return $HTML;
    }, 10, 5 );
    Plugin Author Daniele Scasciafratte

    (@mte90)

    Hi I don’t understand, I asked various things in the previous post.
    Just the code isn’t enough to understand what is happening.

    Closed as we moved to the premium support.

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