0

Our organization is having a blogger blog and now we are planning for website and in which we are planning to call the blog page using iframe, but when we does the entire blog page comes in and we want to remove or hide the blog header when called inside the website, Is there any way to do this

Kiran M R
  • 91
  • 7
  • 1
    Your only option is to manipulate the template / use a custom template on Blogger. You can't manipulate content in the iframe if it's loaded from a different domain. – chrki Apr 22 '17 at 12:42

2 Answers2

1

Blogger allows you to add custom CSS and Javascript to your template.

I tested this based on the "Simple" theme with no further modifications. Go to Theme - Edit HTML in your blog's settings and add this code (based on this snippet) somewhere below the header widget:

<script type="text/javascript">
if (window.self !== window.top){
    document.getElementById("header").style.display = "None"
}
</script>

header is the id of that widget as defined in the HTML template:

<b:section class='header' id='header' ...
Community
  • 1
  • 1
chrki
  • 6,143
  • 6
  • 35
  • 55
1

Thanks for the answer guys, I resolved it by using the following in the blog code

<script type="text/javascript">
   var isInIFrame = (window.location != window.parent.location);
   if(isInIFrame==true){

       document.getElementById('tohide').style.display = "none";
       }   
</script>
Kiran M R
  • 91
  • 7