ASPX templates
Version 5.x > ASPX templates > help with template page View modes: 
User avatar
Member
Member
lwhittemore-emh - 6/7/2011 10:20:32 AM
   
help with template page
I have a banner slider web part that pulls all the images from the path relative to the page you are on. IS there a way in my template to not show the layout if there is nothing to display in the current path.

here is the site I am working on http://173.203.24.234:8005/Blog.aspx

and here is the code that I want to hide if no images are present
<div id = "image_slider_wrapper">
<div id = "image_slider">
<div id = "image_slider_pad">
<uc2:LWSJQuiryRotatingBanner ID="LWSJQuiryRotatingBanner2" Path="./%" Width="524" PauseLength="7000" Height="330" TransitionType="Slide" runat="server" />
</div>
</div>
<div class = "cl"></div>
</div>

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 6/8/2011 2:25:32 AM
   
RE:help with template page
Hello,

Basically, you should be able to determine in the code-behind of your custom web part whether the dataset is empty. According to this information you'll set the Visibility property of the web part to false or true accordingly. This way is described in another forum post: Show/hide webpart.

Hope this is what you are after.

Best regards
Ondrej Vasil