Image Gallery - No Images

Posted by Community Admin on 03-Aug-2018 14:05

Image Gallery - No Images

All Replies

Posted by Community Admin on 07-Jul-2015 00:00

Is there a simple way in the template to show a "no images" sign if your custom module has no images for that entry?

Posted by Community Admin on 10-Jul-2015 00:00

Hello David,

What I can suggest is that you use the conditional control in the markup of your template and render data depending on a condition. The "If" attribute should contain a boolean value. Here is an example of how you can check if there are related items and if yes to render the related items and if there are no related items to render the desired text:

<sf:Conditional If='<%# ((int)Eval("RelatedFieldName.Count")) != 0 %>' runat="server">
    <Then>
        <h2>Here are the related images</h2>
                    
        <asp:Repeater runat="server" DataSource='<%# Eval("RelatedFieldName") %>'>
<ItemTemplate>                           
<%-- here goes your custom logic for displaying the data for the related items --%>                             
          </ItemTemplate>
 </asp:Repeater>    
                                                  
    </Then>
    <Else>    
      <h2>There are no related images for this item.</h2>
    </Else>
</sf:Conditional>

Please note that the Conditional control is type of Telerik.Sitefinity.Web.UI and you need to register the namespace in your widget template in order to use it:

<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>

Regards,
Sabrie Nedzhip
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 10-Jul-2015 00:00

Thanks Sabrie,

 Exactly the tool I needed.

This thread is closed