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