Hi all,
This is more of a learning question for me (I'm new to MVC) to work out the best and most maintainable way to change the layout of a page with nop 2.1, in this instance; the way product reviews are rendered.
I'm trying to put the product reviews on the product page.
In my theme folder I've copied and altered the Product.cshtml page and I've added
@Html.Action("ProductReviews", "Catalog", new { productId = Model.Id})
into the spot that I want the reviews rendered. This obviously renders the whole Product review page, which I want to continue to be able to use separately) so I need to strip it back to just the list of reviews without the layout, creation section.
I've done that and it works except then the Product review separate page obviously doesn't work properly.
Should I create another View called ProductReviewsList.cshtml and call like this:
@Html.Action("ProductReviewsList", "Catalog", new { productId = Model.Id})
I then would need to alter the CatalogController.cs to include the ProductReviewsList action and I read on Skyler's cheat sheet that altering these classes is a bad idea maintenance wise.
Another approach I could take is adding a List<ProductReview> to the Product Model and then do a partial view for the review list. Thoughts on that? Is that the same maintenance problem because I'm altering a nop class?
Any help is greatly appreciated.
Thanks,
Greg