Jump to content

dominikradl

Approved members
  • Posts

    1
  • Joined

  • Last visited

About dominikradl

dominikradl's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I successfully use revive in a nuxt installation with server– and client-side routing. You are almost there, except some small but key things. 1. keep your reviveId in an env var (not necessary, but recommended) and register it in nuxt.config.js (see https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-env) 2. Load the asyncjs.php in head(): head() { return { script: [ { hid: "revive", src: `https://your-revive-server.com/www/delivery/asyncjs.php?slug=${this.data.slug}`, async: true, body: true, callback() { reviveAsync[process.env.reviveId].apply( reviveAsync[process.env.reviveId].detect() ); }, } ] } } You may notice, there are some differences to your code. - append a route-specific var to the script, so that it reloads with every client-side route change - add a callback function that calls reviveAsync[].detect() (which is an object provided by asyncjs.php) 2. In my Ad.vue component I use the zone invocation tag – and also provide a set of dynamic key value pairs as site variables (attributes is a computed property returning an object of key-value pairs, reviveId is a computed property returning the reviveId env var): <ins :data-revive-zoneid="zone" :data-revive-id="reviveId" v-bind="attributes" ></ins> Hope this helps.
×
×
  • Create New...