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:
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>
The new view looks like:
0 comments:
Post a Comment