Label Posts

Website bawlna

AD (728x90)

Friday, October 7, 2016

Header menu view remove from dynamic view blogger

Share it Please



As a follow up on my first article on Dynamic Views, http://blog.mridey.com/2015/08/how-to-customize-bloggers-dynamic-views.html, here's a quick trick to remove the "views" menu in the menu bar.

Typically at the top of all Dynamic Views templates, you'll see a menu to select views other than the one you selected for your blog. It looks something like:


But what it you would prefer not to have this menu, then go to the template editor and change the view loading code from

<script language='javascript' type='text/javascript'>
  window.onload = function() {
    blogger.ui().configure().view();
  };
</script>

to

<script language='javascript' type='text/javascript'>
  window.onload = function() {
    blogger.templates().compile(
        blogger.templates().template("Header").raw()
            .replace(/{block:HasViews[\s\S]*block:HasViews}/,""));
    blogger.ui().configure().view();
  };
</script>

This will remove the section of the Header conditioned on having views {block:HasViews}...{/block:HasViews}that renders the menu for the views.

The new view looks like:

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

© 2013 khenno. All rights resevered. Designed by