cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to hide index page content?

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Is there a way to hide index page content?

Hello,

 

I am customizing the Magento template and it is working so far. There is one thing i cannot do, though.

 

I have a Home Page with some nonsense content that I need to hide.

 

How can I do it? I tried with <referenceContainer name="content" remove="true"> defined in cms_index_index.xml, but all content area was removed, including a slideshow and featured products.

 

Any help will be greatly appreciated, thanks

 

Jaime

4 REPLIES 4

Re: Is there a way to hide index page content?

Re: Is there a way to hide index page content?

That would be possible if there is a HTML tag to be hidden. In this case, the HTML is:

 

 
<div class="column main">
<div class="magestore-bannerslider">
<div class="magestore-bannerslider"> </div>
<input type="hidden" value="mc8DLg5cCmCPDL4R" name="form_key">
<div id="authenticationPopup" style="display: none;" data-bind="scope:'authenticationPopup'">
<div class="magestore-bannerslider"> </div>
<div class="magestore-bannerslider"> </div>
<p>Aquí va el texto de bienvenida al sitio.</p>
</div>
What I need to hide is 
<p>Aquí va el texto de bienvenida al sitio.</p>
So, I cannot use display: none without the possibility to hide anoher element in the page.
 
I could hide the title with
 
<referenceBlock name="page.main.title" remove="true" />
in cms_index_index.xml. I am wondering if there is an elegant way to hide the page content in home page the same way as I have done with title. I can also add a text with font color #fff or the HTML in the page body of the CMS but that would also be a trick.
 
Regards,
Jaime
 

Re: Is there a way to hide index page content?

"That would be possible if there is a HTML tag to be hidden."

<p> is a HTML tag too.

Just use a CSS combinator with p: http://www.w3schools.com/css/css_combinators.asp

Re: Is there a way to hide index page content?

It is not that simple as you think. I cannot do it without the possiblity to hide another element accidentally.

 

But never mind. I have set the page content to be:

 

<font color="###">.</font>

It is tricky, but it worked :-)