PDA

View Full Version : vBulletin 3.8.7 in iframe - hide header


The other Geek
04-16-2014, 11:10 AM
Hi, I need an advice how to hide header of the forums if they are loaded in an iframe. What I need is:

- use iframe to show/embed forums on one website, let's say www.website.com/en/forums
- but if the forums are loaded as an iframe, hide its header/logo. The reason is I do not want to show two logos (one in website header, the second from forums)

The header template has following code:

<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[right]" id="header_right_cell">
<if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else />&nbsp;</if>
</td>
</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output

$ad_location[ad_header_end]

We tried to put this behind the <!-- logo --> but it didn't work and it has broken the template:


<script type="text/javascript?>
isInIframe = (window.location != window.parent.location) ? true : false;
if (isInIframe){document.querySelector( 'body table' ).remove();}

</script>

Is there someone who can help me with this? Which code should I use to do that?

Regards