1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / News - Thumbnail Issue

News - Thumbnail Issue

11 posts, 0 answered
  1. Nisha
    Nisha avatar
    17 posts
    Registered:
    17 Jun 2009
    11 Sep 2009
    Link to this post
    Hi,
        I am using News control , my problem is when i add the new news item without adding Thumbnail image it dosent  display that news item on the frontend site. Only the news items that have thumbnail image are display on the site. My requirement is i dont want this field as mandetory. If the thumbnail image is there then only it should display otherwise that news item should display with other details on the site.How can i solve this problem?

    Waiting for reply.
    Thank you ,
        Nisha
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 Sep 2009
    Link to this post
    Hello Nisha,

    I am using News control , my problem is when i add the new news item without adding Thumbnail image it dosent  display that news item on the frontend site. Only the news items that have thumbnail image are display on the site.

    The NewsView control displays all item no matter whether Thumbnail metadata is set for this item. Thumbnails are not mandatory when you create or edit news content items. Have you made any customization to NewsView control or NewsModule. Which version do you use?

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. warfee
    warfee avatar
    27 posts
    Registered:
    10 Aug 2007
    25 Nov 2009
    Link to this post
    I am also having the same problem but with a custom field which accepts a image url. If the main image field is empty then the rest of content doesn't appear.
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    25 Nov 2009
    Link to this post
    Hello warfee,

    As Ivan has outlined this is not default behavior. There should be something wrong with your template. Would you like to send us your public view templates so that we can inspect them and see what might be wrong?

    Greetings,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. warfee
    warfee avatar
    27 posts
    Registered:
    10 Aug 2007
    30 Nov 2009
    Link to this post
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ListPageDetails.ascx.cs" Inherits="Includes_Sitefinity_ControlTemplates_News_ListPageDetails" %> 
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls" TagPrefix="sfWeb" %> 
    <%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Web.UI.SpamProtection" TagPrefix="sfWeb" %> 
     
    <telerik:JsFileLink id="jsLink" runat="server" ScriptType="jQuery" /> 
         
    <div class="articleDetails"
        <div id="articleHdr"
            <div class="title"
                <h2 class="title"><asp:Literal ID="Title" runat="server"></asp:Literal></h2
            </div> 
            <span class="byline">  
              <asp:Literal ID="Author" runat="server"></asp:Literal> 
             <asp:Literal ID="Source" runat="server"></asp:Literal> 
           </span> 
           <span>|</span> 
            <span class="articleTimeStamp">  <asp:Literal ID="Publication_Date" runat="server" Text="{0}" /></span>            <span>|</span> 
        </div> 
        <div id="articleBody"
            <div class="floatbox"
               <asp:Image ID="MainImage" runat="server" CssClass="mainImage float_left" /> 
              <asp:Literal ID="content" runat="server"></asp:Literal>  
               
            </div>           
        </div> 
        <div id="articleInfo"
         <span class="category">Posted under: <asp:HyperLink ID="Category" runat="server" /></span
         <asp:Repeater ID="Tags" runat="server"
            <HeaderTemplate><span class="sf_postTags">Tags: </HeaderTemplate> 
            <ItemTemplate> 
                <asp:HyperLink ID="tagLink" runat="server" />,  
            </ItemTemplate> 
            <FooterTemplate></span></FooterTemplate> 
        </asp:Repeater> 
         
        </div> 
         
        <asp:Panel ID="Panel1" runat="server" Visible="false" > 
         
        <asp:HyperLink ID="backToList1" Text="<%$Resources:AllNews %>" CssClass="sf_back" runat="server"></asp:HyperLink> 
        <asp:Literal ID="Summary" runat="server"></asp:Literal> 
        <asp:Repeater ID="Bookmarks" runat="server"
            <HeaderTemplate><p class="sf_postBookmark"></HeaderTemplate> 
            <ItemTemplate> 
                <asp:HyperLink ID="BookmarkLink" runat="server"
                    <asp:Image ID="BookmarkImage" runat="server" /> 
                </asp:HyperLink> 
            </ItemTemplate> 
            <FooterTemplate></p></FooterTemplate> 
        </asp:Repeater> 
        <div id="comments" class="sf_contentComments"
            <sfWeb:CommentsList id="commentsList" runat="server" cssclass="sf_commentsList" ValidationGroup="commentInfo"></sfWeb:CommentsList> 
        </div> 
        </asp:Panel> 
    </div> 
     

  6. warfee
    warfee avatar
    27 posts
    Registered:
    10 Aug 2007
    30 Nov 2009
    Link to this post
    using System; 
    using System.Collections; 
    using System.Configuration; 
    using System.Data; 
    using System.Linq; 
    using System.Web; 
    using System.Web.Security; 
    using System.Web.UI; 
    using System.Web.UI.HtmlControls; 
    using System.Web.UI.WebControls; 
    using System.Web.UI.WebControls.WebParts; 
    using System.Xml.Linq; 
     
    public partial class Includes_Sitefinity_ControlTemplates_News_ListPageDetails : System.Web.UI.UserControl 
        protected void Page_Load(object sender, EventArgs e) 
        { 
     
           // MainImage.ImageUrl+= "?width=310&height=0"; 
           //    throw new Exception("something went wrong" + MainImage.ImageUrl ); 
             
           if (!String.IsNullOrEmpty(MainImage.ImageUrl.Replace(" ", ""))) 
            { 
               MainImage.ImageUrl += "?width=310&height=0"; 
            } 
           else 
           { 
              MainImage.Visible = false
           } 
     
             
        } 
     
  7. warfee
    warfee avatar
    27 posts
    Registered:
    10 Aug 2007
    30 Nov 2009
    Link to this post
    Currently I have to be defaulting the MainImage field to spaces(2), and then trimming or removing the spaces, and hiding the image if blank.

    If no spaces are entered in the MainImage field, then the entire article doesn't show up.
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Nov 2009
    Link to this post
    Hi warfee,

    Can you take a look at the following article - How to replace urlWhitespaceChar in your Images and Documents library items. We have built in methods that do replace the white spaces in items urls on items coming from the Sitefinity Libraries.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. warfee
    warfee avatar
    27 posts
    Registered:
    10 Aug 2007
    01 Dec 2009
    Link to this post
    Actually I am just using the blank spaces to indicate content exists, in reality that MoreImage field really should be blank. But when it is blank as I have indicated before the news item doesn't show. So don't pay that particular piece of code any mind.
  10. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    02 Dec 2009
    Link to this post
    Hello warfee,

    Can you try to do the follwowing. Add a literal that will not be visible. This literal will have the same ID as the name of your meta field. Then on page load if the literal has the url as its text, pass this to the image control image url, if not set both controls not to not visible.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. warfee
    warfee avatar
    27 posts
    Registered:
    10 Aug 2007
    02 Dec 2009
    Link to this post
    Thanks man, that really worked.

    if (!String.IsNullOrEmpty(MainImage.Text))
            {
                MainImage_Control.ImageUrl = MainImage.Text + "?width=310&height=0";
                MainImage_Control.Visible = true;
            }
Register for webinar
11 posts, 0 answered