Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • 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 967 Views 1 Watching
  • 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.
  • daniD
    daniD
    dani
    wrote on 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&amp;uniq=176&amp;locationId=7675416&amp;lang=en_US&amp;year=2019&amp;display_version=2" data-loadtrk onload="this.loadtrk=true"></script>

    https://danielcampbell.ca

    1 Reply Last reply
    0
    • mariusjopenM
      mariusjopenM
      mariusjopen
      Global Moderator
      wrote on 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
      • daniD
        daniD
        dani
        wrote on 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
        • mariusjopenM
          mariusjopenM
          mariusjopen
          Global Moderator
          wrote on 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
          • daniD
            daniD
            dani
            wrote on 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
            • mariusjopenM
              mariusjopenM
              mariusjopen
              Global Moderator
              wrote on 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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              Online Users
              A
              Anna_S
              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.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Search