Conditional Show Content

I want to be able to easily show a temporary notice on some of my site’s pages. Is there a way I can have them conditionally rendered? For example: show a Global Block on the page only until a certain date, and/or only if it has content. I know I can edit a Global Block’s content but if I wanted to completely hide it I think I would have to remove references to it on every page, or else edit its CSS as in display:none although it would still be in the HTML source.

Hello @KMCTB,

Thanks for writing in! Regretfully there isn’t a feature that show a Global Block on the page only until a certain date. The global block displays all time long. You might need a 3rd party plugin for this kind of feature.

Thank you for your understanding.

Thanks for the quick reply. I found the “Display During Conditional Shortcode” plugin that can show/hide some content.

Is there a way to create a Cornerstone component so that I can inject some text/content when using its shortcode? If not what’s the best way apply CSS from a Cornerstone element to my own div, for example?

Hello @KMCTB,

If you want to create your own Cornerstone element, please check this knowledge base article:

And to apply your own custom css, you can simply add a custom my-element-id ID or custom my-element-class class to the element with in Cornerstone. Find the “Customize” tab in the element settings.

You can then add your custom css in the page or in the global css, X > Theme Options > custom css.

#my-element-id {
  // your styling css

.my-element-class {
  // your styling css

You can even insert an inline css as well if the css is used only once and on that element only.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.