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

Forums / Developing with Sitefinity / Photo Gallery + News

Photo Gallery + News

7 posts, 0 answered
  1. WebGeek
    WebGeek avatar
    186 posts
    Registered:
    20 Dec 2006
    21 Oct 2008
    Link to this post
    I found the following KB article on how to associate content items with files (http://www.sitefinity.com/support/knowledge-base/kb-article/b1154K-bakd-b1154T-cgh.aspx), and I was wondering  how I could modify it to allow me to assiociate an entire photo gallery? 

    Basically what I would like to do is give my users the ability to select a photo gallery to attach to their news release.
  2. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    22 Oct 2008
    Link to this post
    Hello medicalwebgeek,

    I've written a blog post and provided the sample code that addresses your request. You can find it here:
    http://blogs.sitefinity.com/Ivan/Post/08-10-22/how_to_associate_image_gallery_with_content_item_e_g_news_item_.aspx

    I hope you'll find it useful. Let us know if there is anything else we can do for you.

    All the best,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    22 Oct 2008
    Link to this post

    Hi Ivan,

    It's great !. Could you see one litle problem in the app_Code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. line 103.

     IContent cnt = cntManager.GetContent(contentView.SelectedItemId);  
    Line 103:                string metaValue = cnt.GetMetaData(this.MetaKey).ToString();  
    Line 104:                if(!String.IsNullOrEmpty(targetPropertyStringFormat))  
     

    Regards
  4. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    22 Oct 2008
    Link to this post
    I apologize,

    I have forget select my Gallery. But I the case of some items of News or other GC have not one associated gallery. How manage this issue.
    Regards
  5. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    23 Oct 2008
    Link to this post
    Hi,

    The Gallery added to the news, how to define the view mode programmatically or other?. Actually the gallery added not open image views, only return to list view when u push over some image. Thanks
  6. WebGeek
    WebGeek avatar
    186 posts
    Registered:
    20 Dec 2006
    24 Oct 2008
    Link to this post
    Great - this is exactly what I need.

    How can I get the images to display when I click on them?  Right now it just takes me back to my news headline page when I click on an image.

    Please advise.
  7. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    29 Oct 2008
    Link to this post
    Hello medicalwebgeek,

    I've written a follow-up post on this subject that fixes this issue:
    http://blogs.sitefinity.com/Ivan/Post/08-10-29/how_to_associate_image_gallery_with_content_item_e_g_news_item_-_finishing_touches.aspx

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.

    Greetings,
    Ivan
    the Telerik team

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