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

Forums / Developing with Sitefinity / Null MetaData Value for Image

Null MetaData Value for Image

8 posts, 0 answered
  1. Jackson
    Jackson avatar
    51 posts
    Registered:
    23 May 2008
    20 Oct 2008
    Link to this post
    I have a metadata value for an image path and I have it set up for this image to show up on the article details page.  Currently, it works great as long as I have an image in there. But if I don't have an image nothing shows up. Not even the article.  How could I set this up so that the image section will only show up if the article has an image path assigned to it.
  2. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    20 Oct 2008
    Link to this post
    Hi Chris,

    Is this for blogs?  Have you attached a custom <metafield> to blogs to store an image path?

    Gabe Sumner


  3. Jackson
    Jackson avatar
    51 posts
    Registered:
    23 May 2008
    20 Oct 2008
    Link to this post
    Gabe,

    Yeah, I've attached the metafield and all is working good. If I have an image path stored in the metafield it shows up great.  If I don't have one nothing at all shows up in the article details page. Not even the title or content.
  4. John
    John avatar
    32 posts
    Registered:
    08 Oct 2008
    20 Oct 2008
    Link to this post
    Hi Chris,

    You know there is a button selector from the Images and Documents module that you could use in your blogs. Maybe using this would resolve the error. I have used this in the News Module and if there are no images, then the article displays just fine. Here is the URL:

    http://www.sitefinity.com/support/knowledge-base/kb-article/b1154K-baba-b1154T-cgh.aspx

    -John
  5. Jackson
    Jackson avatar
    51 posts
    Registered:
    23 May 2008
    20 Oct 2008
    Link to this post
    Forgot to mention this is for the news module. 

    Thanks John, I don't think that really solves my problem though. I already have all of the image paths stored in the metafields. Its just that some of the articles have a null value because there is no image.  When there is this null value nothing shows up on the details page for the article.  It works fine for the thumbnails on the list.

    Thanks,
    Chris
  6. John
    John avatar
    32 posts
    Registered:
    08 Oct 2008
    20 Oct 2008
    Link to this post
    Hi Chris,

    Have you tried setting a default value for the meta field like this:

      <add key="Blogs.View_Count" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="0" />

    Would this just show you a image with an "X" on it?

  7. Nick
    Nick avatar
    91 posts
    Registered:
    04 Aug 2008
    21 Oct 2008
    Link to this post
    what do you mean by not being displayed?

    is the the source code full, but simply not being displayed?
  8. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    21 Oct 2008
    Link to this post
    Hello Chris,

    If you still experience the problem, please open a new support ticket and send us the following information:
    1. The project web.config file
    2. The news details template

    Also, do you use a custom control that extends from NewsView base class? And if yes, you could investigate the following topic of the Developer Manual: Example: Extending Content View Control

    Do let us know how it goes.

    Regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
8 posts, 0 answered