Announcement

Collapse
No announcement yet.

vBulletin 3.8.7 in iframe - hide header

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • vBulletin 3.8.7 in iframe - hide header

    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:
    Code:
    [COLOR=#222222][FONT=arial]<!-- logo -->[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]<a name="top"></a>[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]<table border="0" width="$stylevar[[/FONT][/COLOR][COLOR=#222222][FONT=arial]outertablewid[/FONT][/COLOR][COLOR=#222222][FONT=arial]th]" cellpadding="0" cellspacing="0" align="center">[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]<tr>[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]   <td align="$stylevar[left]"><a href="$vboptions[forumhome].[/FONT][/COLOR][COLOR=#222222][FONT=arial]ph[/FONT][/COLOR][COLOR=#222222][FONT=arial]p$session[sessionurl_q]"><[/FONT][/COLOR][COLOR=#222222][FONT=arial]img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]   <td align="$stylevar[right]" id="header_right_cell">[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]       <if condition="$ad_location['ad_[/FONT][/COLOR][COLOR=#222222][FONT=arial]he[/FONT][/COLOR][COLOR=#222222][FONT=arial]ader_logo']">$ad_location[[/FONT][/COLOR][COLOR=#222222][FONT=arial]ad_[/FONT][/COLOR][COLOR=#222222][FONT=arial]header_logo]<else />&nbsp;</if>[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]   </td>[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]</tr>[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]</table>[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]<!-- /logo -->[/FONT][/COLOR]
    
    [COLOR=#222222][FONT=arial]<!-- content table -->[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]$spacer_open[/FONT][/COLOR]
    
    [COLOR=#222222][FONT=arial]$_phpinclude_output[/FONT][/COLOR]
    
    [COLOR=#222222][FONT=arial]$ad_location[ad_header_end][/FONT][/COLOR]
    We tried to put this behind the <!-- logo --> but it didn't work and it has broken the template:

    Code:
    [COLOR=#000000][FONT=Helvetica] <script type="text/javascript”> [/FONT][/COLOR]
      [COLOR=#000000][FONT=Helvetica] isInIframe = (window.location != window.parent.location) ? true : false;
      if (isInIframe){document.querySelector( 'body table' ).remove();}
     [/FONT][/COLOR]
      [COLOR=#000000][FONT=Helvetica]</script>[/FONT][/COLOR]
    Is there someone who can help me with this? Which code should I use to do that? I am sorry that I post here, but I should have permission to post in proper support category, but it does not work... Regards

  • #2
    Hello

    For help with custom coding, please visit www.vbulletin.org - we cannot support custom coding here, sorry.
    MARK.B | vBULLETIN SUPPORT

    TalkNewsUK - My vBulletin 5.6.4 Demo
    AdminAmmo - My Cloud Demo

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X