Answers iFrame from page that isn't the /index.html

Hi,

I’m working with a client that’s hosting their Answers experience on a page that isn’t /index.html. Instead, they’re hosting it on /answers-index.html (since there’s already an existing /index.html in their site).

Therefore, when they look to integrate their Answers experience via iframe, the iframe element doesn’t have a valid src URL. How does one go about iframing Answers from a non-index page?

Hi Luc,

This should be possible using the data-path attribute.

You can find the instructions under this guide here and I have copied them here as well:

To display a specific page in your experience (like a vertical page, or an international subfolder), you can add the data-path attribute in your script tag.

By default, the script tag will pull in the root folder of your experience, landing users on the index.html page. Adding data-path to the script tag will append /[[data-path]] to the iframe’s src .

<div id="answers-container" data-path="locations.html"></div>
<script src="REPLACE_ME_PRODUCTION_URL/iframe.js"> </script>

Let me know if that does not work or you have further questions.

Best,
Alyssa

1 Like