jsg
jsg

Reputation: 1264

nopcommerce pulling images from news page

Hi I'm new to NopCommerce, but I need some help, I'm currently doing some work on the news list page and I'm wondering is there any code that will need to be added to pull any images that are on the actual news page. So the list page will display some of the content and a image.

Upvotes: 1

Views: 205

Answers (1)

Riaz Hosein
Riaz Hosein

Reputation: 131

Just to clarify, you want to display images on http://yoursitename.com/news. These images are currently available if you go to the actual news article.

I don't think there's an out of the box solution for what you want. On Views/News/List.cshtml, you'll have to retrieve the news' full description and parse the html for images.

Alternately, you can reference the image in the Short Description. Unfortunately, you'll have to write the HTML yourself instead of getting an editor the way the full description provides. But, its not too difficult. So, in the short description, put something like the following into the short description field.

<img src="https://www.google.co.uk/images/srpr/logo11w.png" /> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Of course, style accordingly using CSS.

Upvotes: 2

Related Questions