nopCommerce Tips: Embedding a Topic In An Existing Page

The basic content included in the standard version of nopCommerce provides a comprehensive shopping experience for most site users. However, there are times when it’s desirable to include dynamic content in an existing page of the site. We’ll cover how to embed a topic in an existing page of your nopCommerce-driven website.

We’ll start with the prerequisite that you’re working with a development environment that includes the nopCommerce project and Visual Studio. Under the Presentation/Nop.Web project, navigate to the Views folder. For this example, we’ll choose the file “details.cshtml”, under the “Order” folder.

Let’s say we’d like to be able to add special offers and promos for customers to see when viewing their order details. First, we’ll create a topic in the nopCommerce Administration/Content Management/Topics. Let’s make the system name “DetailsPromo”, so that we can remember this for later.

Now let’s go back to details.cshtml; in the div with the class of “order-details”, we’ll add this line:

@Html.Action("TopicBlock", "Topic", new { systemName = "DetailsPromo" })

Now, we can include content via the administration section of the site; thus, we can include a “Thanks for shopping with us” offer, or a notice that due to weather conditions, all shipping will be delayed by X, or any other information that might be relevant to share with our customers. Pretty slick, huh?


Looking for quality nopCommerce Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , | Posted under nopCommerce | RSS 2.0

Author Spotlight

Carole Bennett

Carole Bennett is the founder and principal of IndigoTea. As a professional IT consultant, Carole has provided solutions for companies as diverse as Verizon, Frito-Lay, Capital One Auto Finance, and Zales Jewelers, parlaying a unique talent for acting as a translator between the worlds of business challenges and technology solutions. She considers multi-tasking skills gained from simultaneously 1) managing a fire performance troupe, 2) raising a family, and 3) working as a full-time IT consultant excellent preparation for her current career incarnation as the driving force behind IndigoTea. "Fire-breathing redhead on a mission" is not just a metaphorical description!

Leave a Reply

Your email address will not be published. Required fields are marked *