Custom tooltip by using xstore standard library

This topic has 4 replies, 2 voices, and was last updated 1 years, 8 months ago ago by Rose Tyler

  • Avatar: Krzysztof
    Krzysztof
    Participant
    April 10, 2023 at 22:20

    Just wondering if there is any method (shortcode or css class) by using standard/build-in Xstore functionality/libraries to create my own custom tooltip ?
    Xstore displays nice tooltips in backend and also Xstore tooltips are available while editing content in Elementor, so maybe I can use it on frontend at any place I want ?
    I would like to display few tooltips here and there, mainly in my custom html code in “HTML Block”, but I do not want to install another plugin for such a basic/small thing 🙂

    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 11, 2023 at 10:44

    Hello, Krzysztof,

    Thank you for contacting us and for using XStore.

    There is no ready shortcode for such tooltips but you may add next code snippet to your child-theme/functions.php:

    add_shortcode('custom_xstore_tooltip', function($atts) {
        if ( !isset($atts['title']) || !isset($atts['content']))
            return;
        echo '<span class="mtips">'.$atts['title'].'<span class="mt-mes">'.$atts['content'].'</span></span>';
    });

    Examples:
    Child-theme/functions.php – https://prnt.sc/pRzcBrU0Vwe4
    Options example – https://prnt.sc/ZAolMIi5ecWN
    Frontend – https://gyazo.com/5e256de22697541c5c6f2a96736fc0ee

    Hope you find the snippet useful for your cases.

    Kind Regards,
    8theme team

    Avatar: Krzysztof
    Krzysztof
    Participant
    April 11, 2023 at 14:20

    nice 🙂 thank you very very much

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    April 11, 2023 at 14:46

    Hello, Krzysztof,

    You’re welcome!
    We kindly ask you to rate our theme, as it will motivate our team to move forward and create even cooler things. Please follow this link to rate – https://themeforest.net/downloads

    Thank you for your time and consideration.

    Kind Regards,
    8theme team

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.