How can I redirect the entire experience page instead of only the block that triggered the redirect?

Hey Everyone!

Quite new to Losant but the journey is relatively smooth so far.
However I ran into an issue of which i’m wondering if can be resolved.

I made a custom HTML block of a device list table. This block is quite similar to the device list template component. So the user sees what the currently selected device is and is able to click on other devices in the list to switch to it.

However, the switching is the part where the struggle is. I made it so that the table row is a link to the experience page with the deviceID as parameter in the URL.

But instead of the whole page being redirected, only the custom HTML block is re-rendered as the new page. Resulting in a tiny box with a new page in it.

image

Hi @Frank_Krol, and welcome to the Losant Forums!

Custom HTML Blocks are rendered within an iframe for security purposes, which is why you’re seeing this behavior. Luckily, there is a very simple solution: Add a target="_parent" attribute to the <a> tag you are using in the block. As in …

<a href="/devices/{{deviceId}}" target="_parent">{{deviceName}}</a>

More info can be found here: HTML a target Attribute

Let us know if you have any other questions, and again, welcome to Losant!