All Nexa pages can be embedded on your own site. However, some are especially made for this, while others are optimized for stand alone usage.
Depending on your CMS system, there are various ways to embed a Nexa page. Since we cannot cover all the possibilities, we have decided to show the most common way, being an iframe.
Step 1
In your CMS system, create an iframe in the place you want to embed Nexa.
If you have access to the complete HTML, you can use the code snippet below.
replace [EVENT-URL] with the URL you find in step 2.
Adjust the width of the iframe, to match your design. Nexa will adjust it's content to the available space.
- <iframe
- id="eventFrame"
- src="[EVENT-URL]"
- style="width: 600px; border: none; display: block;"
- scrolling="no"
- allowfullscreen="true"
- ></iframe>
- <script>
- window.addEventListener("message", function (event) {
- if (event.data.type === "setHeight") {
- const iframe = document.getElementById("eventFrame");
- iframe.style.height = event.data.height + "px";
- }
- });
- </script>
When embedding a page in an iframe, you need to specify both height and width of the iframe. Since the height of the Nexa page can vary, you need to add the JavaScript as well. This ensures, that the iframe will adjust it's size to the actual content of the Nexa page. The JavaScript must be placed AFTER the iframe tag.
Step 2
Locate the URL of the Nexa event page by opening the event and find the "Copy URL" button in the "Overview" for the event.
You need the URL in the next steps.