Adding an image field to News articles

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 anos atrás
Hi,

My customer would like to add an image to news articles which displays on the news listings (ie the image is not embedded in the article but displays as a thumbnail next to the news article). Does anybody know if it would be possible to add this? Should I just dig through the code for how category images are stored and try and duplicate this function for news articles or is there an easier way?

Many thanks,
Nick
11 anos atrás
nmg196 wrote:
Hi,

My customer would like to add an image to news articles which displays on the news listings (ie the image is not embedded in the article but displays as a thumbnail next to the news article). Does anybody know if it would be possible to add this? Should I just dig through the code for how category images are stored and try and duplicate this function for news articles or is there an easier way?

Many thanks,
Nick


That would be my recommendation.  Just add a PictureId int field to the News table and look at how the other pages handle that on the admin side.  It will make it a snap and then in your view you just use the picture service to get the thumbnail at the size you want.  The only tricky thing is to make sure your admin model has the PictureId property tagged as [Picture] or something like that.  That's how it knows to use that upload/display control instead of a textbox with the Id in it.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.