Jump to content

make a markup region be removed from markup, not just empty?


darrenc
 Share

Recommended Posts

lets say, in _main.php I have some placeholder regions for content/sidebar

<div id="content">foo</div>
<div id="sidebar">bar</div>

in my home.php template, maybe i don't want the sidebar div at all. But when I put in the intentionally blank code

<region id="sidebar"></region>

I simply make my sidebar div blank, it doesn't remove it.

Q: Is there a slick way to simply nuke that div#sidebar entirely from markup?

Link to comment
Share on other sites

@darrenc Yes 'pw-remove' works.

Maybe it's about being consistent? Try using the <region> tag for all rather than mix-n-matching <region> & <div>

Instead of using

<div id="sidebar"></div>

use

<region id="regSidebar">
  <div id="Sidebar">xxx</div>
</region><!--regSidebar-->

Then in your template where you don't want to display the sidebar, simply put

<region id="regSidebar"></region>

This has always worked for me and helps me keep track of the regions. Many roads up the mountain ? 

 

 

 

 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...