Add picture field in Blog.

5 years ago
I have add a picture field in Blog. I have success fully upload picture in blog.

When i am getting picture to show in blog show picture with blog. but after some time it show error


Method not found: 'nop.web.models.media.picturemodel nop.web.models.blogs.blogpostmodel.get_picture() in nopcommerce

My code is

int? productThumbPictureSize = null;
           int pictureSize = productThumbPictureSize.HasValue ? productThumbPictureSize.Value : _mediaSettings.ProductThumbPictureSize;

           if (blogPost.Picture != null)
           {
               var picture = _pictureService.GetPictureById(blogPost.Picture.Id);


               PictureModel pictureModel = new PictureModel();

               pictureModel.ImageUrl = _pictureService.GetPictureUrl(picture, pictureSize);
               pictureModel.FullSizeImageUrl = _pictureService.GetPictureUrl(picture);
               model.PictureModel = pictureModel;
           }
5 years ago
dalbeersandhu89 wrote:
I have add a picture field in Blog. I have success fully upload picture in blog.

When i am getting picture to show in blog show picture with blog. but after some time it show error


Method not found: 'nop.web.models.media.picturemodel nop.web.models.blogs.blogpostmodel.get_picture() in nopcommerce

My code is

int? productThumbPictureSize = null;
           int pictureSize = productThumbPictureSize.HasValue ? productThumbPictureSize.Value : _mediaSettings.ProductThumbPictureSize;

           if (blogPost.Picture != null)
           {
               var picture = _pictureService.GetPictureById(blogPost.Picture.Id);


               PictureModel pictureModel = new PictureModel();

               pictureModel.ImageUrl = _pictureService.GetPictureUrl(picture, pictureSize);
               pictureModel.FullSizeImageUrl = _pictureService.GetPictureUrl(picture);
               model.PictureModel = pictureModel;
           }


Did you use any plugin that use nop.web as reference? If have and if it contains old contains nop.web.dll .

It may replace your new nop.web.dll if have any.
5 years ago
Yes i have use plugin that use nop.web as reference?

Any solution for that ?