Support » Plugin: Simple Side Tab » Launch Typeform Modal Popup

  • Resolved fonejacka

    (@fonejacka)


    Hi,

    I’d really appreciate some help if possible. I’ve put the side tab into my website, but I’d now like to launch a popup modal from it.

    I have the popup code provided by typeform :

    Launch me!
    <script>(function(){var qs,js,q,s,d=document,gi=d.getElementById,ce=d.createElement,gt=d.getElementsByTagName,id=’typef_orm_share’,b=’https://s3-eu-west-1.amazonaws.com/share.typeform.com/&#8217;;if(!gi.call(d,id)){js=ce.call(d,’script’);js.id=id;js.src=b+’share.js’;q=gt.call(d,’script’)[0];q.parentNode.insertBefore(js,q)}id=id+’_’;if(!gi.call(d,id)){qs=ce.call(d,’link’);qs.rel=’stylesheet’;qs.id=id;qs.href=b+’share-button.css’;s=gt.call(d,’head’)[0];s.appendChild(qs,s)}})()</script>

    I’m not sure if I have to maybe add two classes to the button or something?

    Thanks,

    Sam

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author srumery

    (@srumery)

    Hey @fonejacka,

    I’m not sure that I can help you with this one. Simple Side Tab is meant to be simple and what you are explaining sounds cool, but a little too complicated for this little plugin.

    If you find a way to pull it off, please let me know. I’d like to see it.

    Scot

    Hi Scot,

    No worries, I did actually manage to work out a solution, so I hope it will help others looking to launch their popup typeforms. The code is as follows :

    / filter the tab output from the Simple Side Tab plugin
    function rum_filter_simple_side_tab_text( $text ) {
    
        $text = '<i class="fa fa-rocket"></i> ' . $text;
    
        return $text;
    }
    add_filter( 'rum_sst_plugin_text_for_tab', 'rum_filter_simple_side_tab_text', 10 , 1 );
    
    //### www.thelogoguy.co.uk Edits - Pop up Rapid Quote
    add_action('wp_footer', 'rapid_quote_js', 50);
    
    function rapid_quote_js() { ?>
        <script type="text/javascript">
            (function($) {
                $('body').append('<a class="typeform-share button" href="https://crispbranding.typeform.com/to/dzUzhg" data-mode="1" target="_blank" style="display:none;">Launch me!</a>');
                
                $('.rum_sst_contents').on('click', function(e) {
                    e.preventDefault();
                    
                    $('.typeform-share').trigger('click');          
                });
                
                var script   = document.createElement("script");
                    script.type  = "text/javascript";
                    script.text  = "(function(){var qs,js,q,s,d=document,gi=d.getElementById,ce=d.createElement,gt=d.getElementsByTagName,id='typef_orm_share',b='https://s3-eu-west-1.amazonaws.com/share.typeform.com/';if(!gi.call(d,id)){js=ce.call(d,'script');js.id=id;js.src=b+'share.js';q=gt.call(d,'script')[0];q.parentNode.insertBefore(js,q)}id=id+'_';if(!gi.call(d,id)){qs=ce.call(d,'link');qs.rel='stylesheet';qs.id=id;qs.href=b+'share-button.css';s=gt.call(d,'head')[0];s.appendChild(qs,s)}})()";               // use this for inline script
                    document.body.appendChild(script);
            })(jQuery);
        </script>
    <?PHP }

    Thanks again 🙂

    Sam

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Launch Typeform Modal Popup’ is closed to new replies.