Editing Blogpost WIth a CustomField of Type Image Field

Posted by Community Admin on 04-Aug-2018 20:33

Editing Blogpost WIth a CustomField of Type Image Field

All Replies

Posted by Community Admin on 17-Sep-2013 00:00

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.

Posted by Community Admin on 20-Sep-2013 00:00

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

Posted by Community Admin on 22-Sep-2013 00:00

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 - "localhost:60876/.../hop-on-over-to-australia.png.tmb

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

Posted by Community Admin on 24-Sep-2013 00:00

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

Posted by Community Admin on 30-Sep-2013 00:00

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

Posted by Community Admin on 03-Oct-2013 00:00

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

Posted by Community Admin on 04-Oct-2013 00:00

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

Posted by Community Admin on 13-Nov-2013 00:00

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

This thread is closed