Hiding Sections in Search and Archive Page

Posted by tmp7 on April 6, 2024

Below condition can be used to hide a section in both views. The archive view is for `site.blogspot.com/year/month` and the Search view is for both terms and label search.

html
<b:section id="Sidebar" cond="!( data:view.isSearch OR data:view.isArchive )">
...
</section>

 You would want to make the section to be visible in the layout editor tho, so we added another one, data:view.isLayoutMode:

html
<b:section id="Sidebar" cond="data:view.isLayoutMode OR !( data:view.isSearch OR data:view.isArchive )">
...
</section>

Comments