We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17035
    • 36 Posts
    Hi all,

    We've installed a script called 'Sendola' on our website. Effectively, it's a div class and a js script that you embed into your website. On the frontend of the site, this then displays an image which when clicked, pops up a modal window to allow users to enter in their mobile number and receive all your contact details to their phone.

    Unfortunately, this isn't happening. When a user clicks the image, you see the modal pop up, but they're then redirected to the homepage of our site.

    The code for Sendola is below:

    <div id="now_send_it_wrapper"><script type="text/javascript" src="http://linktosendolawebsitehere.com/script/location/here"></script></div>


    I know that if you're using named anchors in MODx, you have to do something along the lines of [[~[[*id]]]]#anchorname with the link, but unfortunately we don't have access to the link.

    Is there anyway I can get this working in MODx ?

    Many thanks,
    Lewis
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I'm afraid that would be a question for Sendola. Their javascript code adds the link to the page, so it's quite true that you have no control over the generation of that link. I've sent their help an email describing the problem; we'll see if they have any suggestions.

      document.getElementById("now_send_it_wrapper_7330").innerHTML += '<a href="#" onclick="sendola.box.show(... 


      Actually, all this does is insert the link that's supposed to open the popup with an iframe. That link should be inactive when clicked and not go anywhere.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 17035
        • 36 Posts
        Hey,

        Thanks for the reply. I thought it probably would be. I contacted Sendola but they couldn't help unfortunately. Their response was as follows:

        Sorry for the delay in getting back to you. I have spoken to our developers about the issue you are having, and it looks like we are currently unable to offer a solution to this issue. None of our developers have experience in MODx but they did suggest this:

        "Would it be possible for them to have some component maybe which accepts the raw html with javascript and does not change the code? then placing that component in the right place on their site"

        You might be able to find an existing component that already exists that does that, I'm not sure.

        In the future we may provide support for MODx sites, but at the moment Sendola is a new product, made by a small team and we simply don't have the resources to build MODx components at the moment. Sorry we can't be of more help.

        Kind regards,
        Lewis
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I got much the same response. So I made a couple of suggestions. There's nothing MODx can do about this, since the URL is inserted into the browser, and MODx only works on the server.

          However, there are a few options besides "#" for a URL; "javascript:void(0)" is arguably a better choice for a "void" URL anyway.

          And I pointed out that the link should be disabled with "return:false" or "prefentDefault()" anyway.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 17035
            • 36 Posts
            Thanks for the help anyway Susan!
              • 17035
              • 36 Posts
              Hi Susan,

              Just received another response from Sendola saying the following:

              Hi Lewis,

              Our developers have looked again at the issue you were having with the Sendola button on your MODx site, and we think we have solved it. Let me know if you come across any more issues.

              Kind regards,

              Alex

              Just checked our site and it's all working! Looks like the two messages may have prompted them to look into it. Thanks for your help!
              Lewis
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Well...
                Hi Susan,

                I passed on that info to our developers and it seems you have solved the issue! Let me know how you get on, or if you have any other suggestions/issues.

                Kind regards,

                Alex
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Would be interested to see your page with the button so I can see what the URL looks like now.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 17035
                    • 36 Posts
                    Our contact page is below:

                    http://www.pinpointdesigns.co.uk/contact/
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      So they just added a return:false to the end of the onclick function of the URL:

                      document.getElementById("now_send_it_wrapper_8303").innerHTML += '<a href="#" onclick="sendola.box.show({iframe:\'http://admin.sendola.com/get/form/8303\',boxid:\'frameless\',width:448,height:280,fixed:false,maskid:\'bluemask\',maskopacity:40,closejs:function(){closeJS()}}); return false;"><img src="http://admin.sendola.com/img/button/button-4.png" alt="Send to my phone" border="0" \/><\/a>'; 
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org