switch off contents of a block not to show

Posted in: Newspaper
Post count: 105

how do I turn off the contents of a block from displaying on website even though I haven’t deleted and later turn it on to show when I need
for instance I created a block in which I would display football scores on weekends but because there won’t be matches weekdays I would like not to turn on that block weekdays since not necessary, would only do that weekends. how can this be done

Post count: 18283

Hello !

That can be achieved by adding an extra class and hiding / showing the element using CSS. As you can see here I have added a flex block but you can use any element, added the weekend extra class: https://www.screencast.com/t/jhxUUGEG6ow ; And using this code I can hide it or show it whenever I want:
https://www.screencast.com/t/AAtH03H7JKs

The code is: .weekend {
display:none;
}

The code must be inserted here: https://www.screencast.com/t/J1Nxw5s5

When you want to hide it simply set the class to none and when you want to display it set it to block

Thank you !

Post count: 18283

Hello !

That can be achieved by adding an extra class and hiding / showing the element using CSS. As you can see here I have added a flex block but you can use any element, added the weekend extra class: https://www.screencast.com/t/jhxUUGEG6ow ; And using this code I can hide it or show it whenever I want:
https://www.screencast.com/t/AAtH03H7JKs

The code is: .weekend {
display:none;
}

The code must be inserted here: https://www.screencast.com/t/J1Nxw5s5

When you want to hide it simply set the class to none and when you want to display it set it to block

Thank you !

Post count: 105

I am using a raw html block and your suggestions are not working with it. tried your suggestions but no change

Post count: 18283

Hello !

Indeed for RAW HTML it seems that it requires a stronger code. Please use this one: .wpb_wrapper.vc_raw_html.weekend {
display: none;
}

Thank you !

Post count: 17

I used this workaround and it works… however, my thought was that the editor must enter the homepage tdcomposer and not the custom css code (which could have scared him too much). The TD Composer is more friendly for him than the custom css code…
Well, it was perfect in my mind that he could write and delete a specific class (“nascondi”, means “hide” in italian) in the extra class fields… BUT… when he put the extra class “nascondi”, the block is hidden in the backend too, and he can’t show it no more because he doesn’t see it.
So, can you suggest to me a contextual selector or class that I could use to hide this block ONLY in the frontend but not in the backend?
Thank you!!!

image1
image2

Post count: 35449

Hi fabrizio_arnone, the theme already has an hide option in tagDiv composer that is working per view port -> https://i.imgur.com/EkTPCxx.png but as the above solution when the option is use the element is hide from tagDiv Composer too.
Unfortunately for the moment there is no option to can hide an element but only from frontend, because the same frontend is load in tagDiv Composer.
Thank you for your understanding!

Post count: 17

Hi Calin thank you for the reply. I already knew this “Display” field, but – as you said – this can work only if I want to hide this element for a specific device and not for all, because in this case I will not see this element no more and I can’t display it no more in the future.
Can you consider that in a magazine online I could need to activate and disactivate an element “like a special reportage or a video live” for a journalistic pourpose and not for responsive reason?
Could you suggest to me a workaround or put this issue in a future release???

in visual composer I got a simple “Disable row” check box and I can still see the element in the backend

Post count: 35449

Hi fabrizio_arnone, unfortunately for the moment your solution is the best to use.
I made a note to our developers to check that option for hidden and if is possible to hide the element only form frontend when you use it.
Hope that it will be implement in the coming updates!
Thank you!

Viewing 9 posts - 1 through 9 (of 9 total)
The forum ‘Newspaper’ is closed to new topics and replies.