Dear all,
I’m sure this came up before, and I thought I had even implemented the solution somewhere… but I’ve tried various searches and came up empty.
I want some elements in my wiki to be visible IFF the wiki is rendering within an iframe, but not when it’s being loaded directly (including, for example, a prominent invitation/link to open the site in its own tab or new window, plus hiding sidebar and other bulky elements, so the iframe can use limited space more efficiently).
I remember there are some variables that can be compared by javascript (variables such as window.location or window.top or window.name or window.self or window.parent …?) where the variables will match when we’re NOT being nested within an iframe…
I do see solutions for generic javascript-enabled html pages in these sites: https://stackoverflow.com/questions/326069/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t and How To Check if a Page Is in an iFrame | Tom McFarlin
… but I’m not confident with setting this javascript up so that its output can be leveraged by css.
Any guidance?
Many thanks in advance!