nopCommerce Tips: How to Add A Custom Page, Part 1

nopCommerce is a top-notch e-commerce system, one of the best open-source .Net-based e-commerce applications available. However, it can be a bit less than straightforward to add additional content to a nopCommerce implementation. Clients may request additional content such as informational pages on the background and history of their products, or a gallery to display previous designs or products. Here’s two ways to accomplish that with nopCommerce.

The first method is the most straightforward; creating a topic, and linking to the topic in your menu. You will be limited to HTML-based content, which will be fine for most purposes, but won’t include widget support. Here are the steps for this method:

1. Log into your nopCommerce instance as an administrator, and access the Admin area

2. Under Content Management, click on “Topics”

3. Click “Add New”, to create your new topic instance

4. Add your information in the screen that follows, and then click “Save & Continue Edit”

5. Now you’ll notice you have a few more options on the screen

The most important is the new URL that’s been added – this is a direct link to your topic, which will be rendered as a page. Click on the link for your preview to see how it’ll display.

6. Now you’ll want to add that link to your menu. For this instance, we’ll open the Nop.Web/Views/Common/Menu.cshtml

You’ll notice that there’s a series of <li> elements, like this:

<li><a href="@Url.RouteUrl("ContactUs")">@T("ContactUs")</a></li>

You’ll want to add another <li> element for your new link. However, your link will look a bit more like this:

<li><a href="@Url.RouteUrl("Topic", new { SystemName = "CustomOrders" })">@T("CustomOrders")</a></li>

nopCommerce uses a specific route method for topics; you’ll want to add your topic’s system name, and you’ll also need to add a resource name and value under your Languages resources.

Save your updated Menu.cshtml, clear your cache, and re-start your application. After these steps, you should see the new link in your menu.

Next time, we’ll cover how to add a page that contains more advanced content, such as a widget and topic combined.


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 *