What is the Sitefinity 5.4 version of ButtonSelector?
What is the Sitefinity 5.4 version of:
<
sf:ButtonSelector
WindowNavigateUrl
=
"~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx"
AssociatedControls
=
"hidBioImage,imgBio"
ItemTemplatePath
=
"~/Sitefinity/Admin/ControlTemplates/Libraries/Dialogs/ButtonSelector.ascx"
runat
=
"server"
cssclass
=
"pickerWrapper"
ButtonText
=
"Select Image"
/>
I've used this on a 5.3 site. I used this in the Backend on a designer.
<
sitefinity:ImageField
ID
=
"ImageSelector"
runat
=
"server"
DisplayMode
=
"Write"
UploadMode
=
"Dialog"
DataFieldName
=
"Image"
/>
Thanks for the tip.
When you say "I would change the DataFieldName to what corresponds to you.", are you referring to the ID of the image that I am updating?
If this is a DynamicModule or widget that you are using the "Image" would be the name of the field in sitefinity that is stored in the Database. For me the field name was "Image".
I have to do something different. I have a personnel bios page, that displays the image of a person, with a link underneath it to select a new image to replace the one above.
So when you click the link and choose a new image, the image displayed above the link is updated to the new one you selected.
Then once I go to save to the database, I can use the image "src" value, as the path to the image to be stored in the database.
So I need to be about to link that control to an image control ID, displayed on the page.
How is the personnel bio built? Are you using the built in profiles for sitefinity users? If so that is built right into the profile view widget. This would be my suggestion if possible for your implementation.
How to use and set up profile/user widget.
Unfortunately that does not have anything to do with Sifefinity profiles. This control is maintaining a table in our MSSQL database, of a list of people that are displayed on a web page. The people displayed are Directors and Executives that do not use our Sitefinity CMS, so they do not have any profiles.
I am guessing that you are creating this via a user control in some custom code. Also based on the fact you need some custom implementation with a custom table. So I might suggest that you look at some of the RadControls
Upload Control
Or this example using the rad grid make the data source your custom table to allow edits and viewing. example
Yes, I am building a custom widget, which displays a radGrid with Bio information from the database. When I click on a name, I use the asp:multiview control, to display a form where the user can update the Bio details.
On that form is an image control, to update the persons photo. It is there I want to have a "Select an Image" link that pops up Sitefinity's standard dialogue box, to allow uploading or selecting from the existing image library.
This is so frustrating, as in 3.7 SP4, all you had to do was:
<
img
id
=
"imgBio"
runat
=
"server"
src
=
"test"
/><
br
/>
<
asp:HiddenField
ID
=
"hidBioImage"
runat
=
"server"
/>
<
sf:ButtonSelector
WindowNavigateUrl
=
"~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx"
AssociatedControls
=
"hidBioImage,imgBio"
ItemTemplatePath
=
"~/Sitefinity/Admin/ControlTemplates/Libraries/Dialogs/ButtonSelector.ascx"
runat
=
"server"
cssclass
=
"pickerWrapper"
ButtonText
=
"Select Image"
/>
Did you try this
<
sitefinity:ImageField
ID
=
"ImageSelector"
runat
=
"server"
DisplayMode
=
"Write"
UploadMode
=
"Dialog"
DataFieldName
=
"Image"
/>
Sorry. Putting that line of code as suggested throws a JavaScript runtime error, with a Sys.WebForms.PageRequestManagerServerErrorException.
I have attached a screenshot of the offending error text.
Another thing that may help, is that this is NOT the widgets controller, but in the widget itself. It is designed to display along with the widget's contents, not as part of it's property display in the control designer.
So I guess this is why a lot of the examples are not working for me, as I'm trying to use them in the widget itself, and the code assumes I am using the designer associated the widget?