Conditional Code in Master file
Hi,
Is it possible to write conditional code in Sitefinity Master pages?.. so if no widgets are used for a placeholder, the markups for the empty placeholder does not show on the website.
For emaxple, I have this code for my sidebar in my Master file:
<div class="Sidebar"> <asp:contentplaceholder id="Sidebar" runat="server" /></div>Hello Marz,
You can check if the div contains any html with a JQuery script on the master page. Something similar to this should do the job:
$(document).ready(function() if ($(".Sidebar").html().length > 0) $(".Sidebar").show(); );