Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. tripadvisor widget

tripadvisor widget

Scheduled Pinned Locked Moved General Discussion
6 Posts 2 Posters 199 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dani
    wrote on Oct 2, 2019, 8:13 AM last edited by
    #1

    hi,

    usually it's no problem to integrate scripts into LAY, but this one uses a URL as the function, which means it can't be wrapped in:

    window.laytheme.on("newpageshown", function(layoutObj, type, obj){

    });

    can anyone help with this?

    <div id="TA_certificateOfExcellence176" class="TA_certificateOfExcellence"><ul id="qyZP9Xq" class="TA_links uebl3Xmuf0G"><li id="47IvIet6" class="sjQ1Y8"><a target="_blank" href="https://www.tripadvisor.com/Attraction_Review-g187147-d7675416-Reviews-Parisitour-Paris_Ile_de_France.html "><img src="https://www.tripadvisor.com/img/cdsi/img2/awards/CoE2017_WidgetAsset-14348-2.png " alt="TripAdvisor" class="widCOEImg" id="CDSWIDCOELOGO"/></a></li></ul></div>

    <script async src="https://www.jscache.com/wejs?wtype=certificateOfExcellence&uniq=176&locationId=7675416&lang=en_US&year=2019&display_version=2 " data-loadtrk onload="this.loadtrk=true"></script>

    https://danielcampbell.ca

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mariusjopen
      Global Moderator
      wrote on Oct 4, 2019, 2:14 PM last edited by
      #2

      Dear @dani
      the code you are embedding with the link (https://www.jscache.com/wejs?wtype=certificateOfExcellence&uniq=176&locationId=7675416&lang=en_US&year=2019&display_version=2 ) is pretty short when opened.

      Maybe LAY cannot read it because it uses a different way of loading JS:
      http://laytheme.com/documentation.html#custom-javascript

      Can you rewrite it maybe?

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dani
        wrote on Oct 6, 2019, 11:21 AM last edited by
        #3

        I can't rewrite it because it comes from Trip Advisor.
        I tried embedding the returned function like this:
        <script>
        window.laytheme.on("newpageshown", function(layoutObj, type, obj){

        (function(t,r,i,p){i=t.createElement(r);i.src="https://www.tripadvisor.com/WidgetEmbed-certificateOfExcellence?year=2019&locationId=7675416&display_version=2&uniq=176&lang=en_US";i.async=true;p=t.getElementsByTagName(r)[0];p.parentNode.insertBefore(i,p)})(document,"script ");

        });
        </script>

        but doesn't work either.

        https://danielcampbell.ca

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mariusjopen
          Global Moderator
          wrote on Oct 8, 2019, 9:33 AM last edited by
          #4

          Dear @dani
          then we might not be able to use this widget.

          Is there a URL on Tripadvisor to which you can link to instead?

          Best!

          Marius

          www.mariusjopen.world

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dani
            wrote on Oct 9, 2019, 10:37 AM last edited by
            #5

            yes, of course, but it won't be dynamic (ie. show latest reviews and # of reviews).

            https://danielcampbell.ca

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mariusjopen
              Global Moderator
              wrote on Oct 10, 2019, 9:42 PM last edited by
              #6

              Dear @dani
              we hope to release a PHP version of LayTheme. Then this will be possible :-D

              Best!

              Marius

              www.mariusjopen.world

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes

              2/6

              Oct 4, 2019, 2:14 PM

              4 unread

              I also code custom websites or custom Lay features.
              💿 Email me here: 💿
              info@laytheme.com

              Before you post:
              1. When using a WordPress Cache plugin, disable it or clear your cache.
              2. Update Lay Theme and all Lay Theme Addons
              3. Disable all Plugins
              4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

              This often solves issues you might run into

              When you post:
              1. Post a link to where the problem is
              2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
              3. If the problem is difficult to explain, post screenshots / link to a video to explain it
              Online Users
              Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
              laytheme.com
              • Login

              • Don't have an account? Register

              • Login or register to search.
              2 out of 6
              • First post
                2/6
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Search