Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not familiar with Kentico but these solutions might help. They may not address your problem specifically but might aid in a solution.</p> <p><strong>CMSEditableImage Extension Method</strong></p> <blockquote> <p>I came up with a way to check this, I added an extension method for the CMSEditableImage class that takes the CurrentPage PageInfo object to check the value of the editable region, don't know if this is the best way or not, but here's the code.</p> <pre><code>public static bool IsPopulated(this CMSEditableImage editableImage, PageInfo currentPage) { bool isPopulated = false; string value = currentPage.EditableItems.EditableRegions[editableImage.ID.ToLower()].ToString(); if (!string.IsNullOrEmpty(value)) { value = value.ToUpper(); isPopulated = (value == "&lt;IMAGE&gt;&lt;PROPERTY NAME=\"IMAGEPATH\"&gt;&lt;/PROPERTY&gt;&lt;/IMAGE&gt;") ? false : true; } return isPopulated; } </code></pre> </blockquote> <p>via <a href="http://devnet.kentico.com/Forums/f19/fp5/t4454/Empty-CMSEditableImage.aspx" rel="nofollow">http://devnet.kentico.com/Forums/f19/fp5/t4454/Empty-CMSEditableImage.aspx</a></p> <p><strong>JavaScript Method</strong></p> <blockquote> <p>The webcontainer needs an id, example:</p> <pre><code>&lt;h2 id="webpart-header"&gt;Headline&lt;/h2&gt; </code></pre> <p>Then I have a small javascript function that is attached in an external js file:</p> <pre><code>/* Hide Webcontainer via javascript if empty*/ function hideLayer(element) { elem = document.getElementById( element ); elem.style.display = "none"; } </code></pre> <p>Now in the wep part configuration, at no data behaviour, you uncheck the checkbox and call the js function by entering following script in the no record found text: hideLayer("webpart-header");</p> <p>Whereby webpart-header the id name of your container is. You could also have a more complex <code>&lt;div&gt;</code> structure here.</p> </blockquote> <p>via <a href="http://devnet.kentico.com/Forums/f22/fp3/t4180/Webcontainer-and-hide-if-no-data.aspx" rel="nofollow">http://devnet.kentico.com/Forums/f22/fp3/t4180/Webcontainer-and-hide-if-no-data.aspx</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload