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

Forums / Bugs & Issues / Editing Blogpost WIth a CustomField of Type Image Field

Editing Blogpost WIth a CustomField of Type Image Field

8 posts, 0 answered
  1. AST
    AST avatar
    5 posts
    Registered:
    30 Jun 2008
    17 Sep 2013
    Link to this post
    We are running 6.1 and have added a number of custom fields to blog posts, including "ImageField" type to save individual images against a blogpost.

    As per the attached the image is being saved and returned via the JSON string, however it is not being displayed. 

    I assume this is a bug ? 

    Thanks

    Matthew

    PS Sorry - this is a duplicate of http://www.sitefinity.com/developer-network/forums/bugs-issues-/editing-blogpost-with-a-customfield-of-type-image-field - I originally posted under my personal login, but this issue is affecting a site on our corporate account so had to repost so it is linked.
  2. Miroslava
    Miroslava avatar
    57 posts
    Registered:
    22 Feb 2016
    20 Sep 2013
    Link to this post
    Hello Matthew,

    I did not manage to reproduce the problem. I tested it with Sitefinity 6.1.4600 and our latest release Sitefinity 6.1.4700. I recorded a short video with my steps. Here is a link to the video:
    http://screencast.com/t/nAjUnNSZhg1V

    I added an Image field to blog posts, then I created and edited a blog post and selected some images.

    Would you give us more details about your project? Which version of Sitefinity are you using? Do you have any languages added? What are the other custom fields of your blog posts? Do you reproduce this issue on any browser or is it reproducible only on a specific one?

    Regards,
    Miroslava
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. AST
    AST avatar
    5 posts
    Registered:
    30 Jun 2008
    22 Sep 2013
    Link to this post
    Hi Miroslava
    Thanks for your reply.
    We are running 6.1.46 which was upgraded from 5.1.32.

    I am pleased to confirm the functionality is now working - I removed all references to custom fields from both within the custom field section of blogs, and then also from within the Administration - Advanced Section. I think I loaded the custom fields within the Administration section which has caused my problems.

    We now however have discovered another issue with respect to the image field. 
    The image is being saved into the database with a fully qualified URL path - "http://localhost:60876/images/homepagerefreshtestimages/hop-on-over-to-australia.png.tmb?sfvrsn=2".

    Our sites are setup whereby we have a site for publishing content (internal LAN) and then an external facing site for public to view. 
    With publishing images on the internal LAN site the URL for the images will therefore not work on the public facing side. 
    Is there a setting within Sitefinity to prevent the URL's being saved as fully qualified ?

    Thanks, Matthew
  4. Miroslava
    Miroslava avatar
    57 posts
    Registered:
    22 Feb 2016
    24 Sep 2013
    Link to this post
    Hi Matthew,

    Currently, we set "Telerik.Sitefinity.Web.UI.Fields.ImageField" type to a short textbox. This is why the value is stored in the database with a fully qualified URL path. 

    The following blog post might be useful to you: 
    http://www.sitefinity.com/blogs/slavoingilizov/posts/slavo-ingilizovs-blog/2011/02/11/creating_a_thumbnail_selector_for_news_items

    Soon there will be an update of the thumbnail selector from this blog post, so you can check for updates.

    Regards,
    Miroslava
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. AST
    AST avatar
    5 posts
    Registered:
    30 Jun 2008
    30 Sep 2013
    Link to this post
    Hi Miroslava

    Thanks for your response.

    A colleague has tried the Thumbnail selector as per your link however we have struggled to get it to work - some questions:

    1. The download in the blog post only contains js files. Is this correct?

    2. In step 4 you detail assemblyinfo entries however they bear no resemblance to the files in the download.
    3. In step 6 you detail to make the custom widget "Telerik.Sitefinity.Samples.SimpleImageField". To get the custom field to save, we had to enter "Telerik.Sitefinity.Samples.SimpleImageSelector" as the custom type, so as to match the .cs file.

    Can you please advise.

    Thanks
    Matthew
  6. Atanas Valchev
    Atanas Valchev avatar
    414 posts
    Registered:
    04 Jan 2016
    03 Oct 2013
    Link to this post
    Hello Matthew,

    I am attaching a fixed ImageSelector for 6.1 that you can try in your project.

    You have to put the following code in the Global.asax file in order to register the field controls.

    protected void Application_Start(object sender, EventArgs e)
           {
               Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
           }
        
           void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
           {
               Telerik.Sitefinity.Web.UI.Dialogs.RegisterDialog<ImageSelectorDialog>();
           }
    In App_Data/Sitefinity/Configuration/VirtualPathSettingsConfig.config add the like that will register virtual path for the embedded image selector templates.

    <add resourceLocation="Controls, Controls" resolverName="EmbeddedResourceResolver" virtualPath="~/Ctrls/*" />

    Lastly, put the following css in the ImageSelectorDialog.ascx file:

    <style type="text/css">
        .sfDesignerSelector {
            position: inherit !important;
        }
    </style>

    When this code is added to the template it is good to delete the cache of the browser.

    Regards,
    Atanas Valchev
    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 Public Issue Tracking system and vote to affect the priority of the items
  7. AST
    AST avatar
    5 posts
    Registered:
    30 Jun 2008
    04 Oct 2013
    Link to this post
    Hi Atanas

    Thank you for your reply and code.

    I have added the code to our site and applied the changes to the global.asax, virtualpathsettings.config & imageselectordisalog.ascx as detailed, and then added the custom field to the blog.

    The image dialogue picker appears, however as soon as you select an image and click on the "Done" button we are returned to the blog post listing page and do not get a chance to select another image or save the change.

    Is this something you have experienced previously ? Are you able to advise what might be causing this problem ?

    Thanks
    Matthew
  8. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    13 Nov 2013 in reply to Atanas Valchev
    Link to this post
    Hi Atanas

    Can you send me the fixed ImageSelector.cs as well because I am struggling with the ImageSelector in 6.2. Thanks in advance

    Kind regards
    Luc
8 posts, 0 answered