Custom widget edit

Posted by netwebtest123@gmail.com on 09-May-2019 12:20

Hi All,

We have created custom widget that content a list with specific filed like Image, Title and Description. We need one more filed in exiting widget how we add new field?

All Replies

Posted by jread on 14-May-2019 15:46

Widget "fields" are placed in the Controller for that custom widget and are public properties, so you would add a new field their and then implement it into the custom Designer view.  Here is the documentation to developing a custom MVC widget. www.progress.com/.../develop-widgets-mvc

Posted by netwebtest123@gmail.com on 15-May-2019 10:31

[mention:618aa021aa0d4f59b0baea5ca3e34d66:e9ed411860ed4f2ba0265705b8793d05] Thanks for your replay.

Current this file "List.SimpleList.cshtml"  content Old UI Filed, I want one more filed in exiting file.

How to know which controller is belong this .cshtml file?

Note: List.SimpleList.cshtml file is created hard file now I want to used in site with new added filed so I can select image whatever I want.

Posted by jread on 15-May-2019 17:14

If you want to add an image field to an existing content type like lists(news,blogs,posts, etc.) you can follow the attached video:

screencast-o-matic.com/.../cqhobITVI3

Docs:

www.progress.com/.../lists

www.progress.com/.../overview-custom-fields

Posted by netwebtest123@gmail.com on 16-May-2019 07:40

[mention:618aa021aa0d4f59b0baea5ca3e34d66:e9ed411860ed4f2ba0265705b8793d05]

I have tried as you mentioned step but didn't update, Can you please tell me how we can used two image filed in one list like one image for "Heading" and one for "Title".

I have created custom filed like "Image2" and write this @item.Fields.Image2.Fields.MediaUrl but didn't work.

Simple. I want two image fields in list how can I achieved 

Posted by jread on 16-May-2019 15:43

Most likely your widget template was cached, try clear your browser cache or rebuilding the solution to precompile the view or turn of view precompilation.  www.progress.com/.../optimize-development

Posted by netwebtest123@gmail.com on 17-May-2019 09:07

Hi [mention:618aa021aa0d4f59b0baea5ca3e34d66:e9ed411860ed4f2ba0265705b8793d05]

I am getting this error  "Exception occured while executing the controller. Check error logs for details."

As per your suggestion this is right syntax @item.Fields.Image2.Fields.MediaUrl  or else ?

Posted by jread on 17-May-2019 18:28

if you set the image to allow for more than one image selection the above code would not work and you would need to iterate over the field value of Image2.

@foreach(var img in item.Fields.Image2){ <img src="@img.Fields.MediaUrl" /> }

Posted by netwebtest123@gmail.com on 20-May-2019 06:32

Hi [mention:618aa021aa0d4f59b0baea5ca3e34d66:e9ed411860ed4f2ba0265705b8793d05] ,

I have tried below code but still not working.

I have list so image will come through loop through like below my code.

I have two separate filed like "image" and "image2" user can upload only one image at a time not more then one.

 

<div class="@Model.CssClass">

   @foreach (var item in Model.Items){

       <div>

           <div>

<img src="@item.Fields.Image" />

           </div>

           <div>

               @foreach (var img in item.Fields.Image2)

               {

                   <img src="@img.Fields.MediaUrl" />

               }

           </div>

       </div>

   }

</div>

Error: Exception occured while executing the controller. Check error logs for details.

Posted by jread on 20-May-2019 14:54

Can you please review the error log and see what the issue(s) is? You can attach it here also for review.

This thread is closed