(heavily edited by @jywarren)
Embeds allow embedding of inline grids, and are available when clicking the faint grey link to the bottom right of each grid:

The generated iframe uses a URL like: https://publiclab.org/embed/grid/nodes:purpleair
Once embedded on another site, when you click links or buttons, the iframe loads an entire instance of the plots2 website within the iframe. It can be quite cumbersome on the browser and the user could get confused very quickly.
Here's an example of this issue:

Link:
https://store.publiclab.org/collections/featured-kits/products/lego-spectrometer-kit?variant=8187504787563
Solution:
We should ensure all links in the /embed/... views are adjusted to have target="_blank" so they open in a new window/tab. We could do this in JavaScript; we'd have to detect the controller action with params[:action] == 'gridsEmbed', because they're run out of:
app/controllers/tag_controller.rb: def gridsEmbed
We'll want to only do this in the embed view, but not for normal inline grids code. The templates are in:
https://github.com/publiclab/plots2/tree/master/app/views/grids/
Any help appreciated!!!
(heavily edited by @jywarren)
Embeds allow embedding of inline grids, and are available when clicking the faint grey link to the bottom right of each grid:
The generated iframe uses a URL like: https://publiclab.org/embed/grid/nodes:purpleair
Once embedded on another site, when you click links or buttons, the iframe loads an entire instance of the plots2 website within the iframe. It can be quite cumbersome on the browser and the user could get confused very quickly.
Here's an example of this issue:

Link:
https://store.publiclab.org/collections/featured-kits/products/lego-spectrometer-kit?variant=8187504787563
Solution:
We should ensure all links in the
/embed/...views are adjusted to havetarget="_blank"so they open in a new window/tab. We could do this in JavaScript; we'd have to detect the controller action withparams[:action] == 'gridsEmbed', because they're run out of:app/controllers/tag_controller.rb: def gridsEmbed
We'll want to only do this in the embed view, but not for normal inline grids code. The templates are in:
https://github.com/publiclab/plots2/tree/master/app/views/grids/
Any help appreciated!!!