Adding Picture property in Topic Entity Content Management Topic Page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 年 前
Hi ,

I have followed the technical documentation on updating the existing entity, but fails to add an image upload option on the topics page,
Following are the edits which i made:
Nop.Core.Domain.Topics.Topic
/// <summary>
        /// Gets or sets the picture identifier
        /// </summary>
        public virtual int PictureId { get; set; }

Nop.Data.Mapping.Topics
this.Property(t => t.PictureId);

Nop.Admin.Controllers.TopicController
#region Fields
private readonly IPictureService _pictureService;
similarly Added picture service in Constructors
#region utilities
   private void UpdatePictureSeoNames(Topic topic)
        {
            var picture = _pictureService.GetPictureById(topic.PictureId);
            if (picture != null)
                _pictureService.SetSeoFilename(picture.Id, _pictureService.GetPictureSeName(topic.Title));
        }

Similarly added    UpdatePictureSeoNames(topic); in edit and create

Nop.Admin.Models.TopicsModel
[NopResourceDisplayName("Admin.ContentManagement.Topics.Fields.Picture")]
        public int PictureId { get; set; }

_CreateOrUpdate.cshtml
                   <tr>
                        <td class="adminTitle">
                            @Html.NopLabelFor(model => model.PictureId)
                        </td>
                        <td class="adminData">
                            @Html.EditorFor(model => model.PictureId)
                            @Html.ValidationMessageFor(model => model.PictureId)
                        </td>
                     </tr>

I cant see the picture upload like catagory in the topic page , any ideas where i am getting it wrong .
Thanks
12 年 前
Sorted out , was missing [UIHint("Picture")] in TopicModel
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.