---
title: How to Display Different Content Based on Category
description: How to Display Different Content Based on Category
---

[Skip to content](https://productcart-kb.nsource.com/kb/how-to-display-different-content-based-on-category1#main-content)

<https://productcart-kb.nsource.com/kb/kb-tickets/new?hsLang=en>

[![pc\_logo](https://productcart-kb.nsource.com/hs-fs/hubfs/pc_logo.png?width=162&height=75&name=pc_logo.png)](https://productcart.com/)

Open main navigation

Close main navigation

- <https://productcart-kb.nsource.com/kb/kb-tickets/new>
- [Contact Support](mailto:help@productcart.com)

[Contact Support](mailto:help@productcart.com)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [ProductCart Help Center](https://productcart-kb.nsource.com/kb?hsLang=en)
2. [How To's](https://productcart-kb.nsource.com/kb/how-tos?hsLang=en)

March 5, 2024

# How to Display Different Content Based on Category

Please note: The contents of this article apply only to licensed versions of the ProductCart software. They do not apply to stores running as a hosted application under a ProductCart Live agreement.

What if you wanted to change elements of your store design (e.g. navigation, graphics, etc.) depending on which category the customer is viewing? You can do so by using conditional statements based on the category ID. You can find out the ID of a category in many ways. For example, when editing the category in the Control Panel, look at the number that follows *?idcategory=* in the browser address field.

In the storefront, the category ID is loaded onto the page ( *viewcategories.asp*) before *header.asp* and *footer.asp* are invoked. Therefore, you can place conditional statements in those files with the assumption that the category ID is known.

## Example 1: One category

Here is a simple example. Let's assume you want to show something different when a certain category is shown. If it's just one category that you need to work with, you can use a simple “IF” statement. For instance, let's assume the category number is *100*. The ASP code would be:   
 

```

<% if pIdCategory=100 then %> Show special content to be displayed when category 100 is shown <% else %> Show something else <% end if %>
```

  

## Example 2: Multiple categories

If you want to show different content depending on the category shown, and you are dealing with a number of different categories, the you will want to use a “SELECT CASE” statement. The ASP code in that case would be:   
 

```

<% Select Case pIdCategory Case 100 response.write("Show this message when category 100 is loaded.") Case 101 response.write("Show this message when category 101 is loaded") Case 102 %> <strong>Use this HTML code when category 102 is loaded</strong>. <% Case else document.write("Show this message when other categories are loaded.") End Select %>
```

 

- [Managing Your Products](https://productcart-kb.nsource.com/kb/managing-your-products?hsLang=en)
- [Managing Orders](https://productcart-kb.nsource.com/kb/managing-orders?hsLang=en)
- [Managing Customers](https://productcart-kb.nsource.com/kb/managing-customers?hsLang=en)
- [Getting Started](https://productcart-kb.nsource.com/kb/getting-started?hsLang=en)
- [Apparel Add-On](https://productcart-kb.nsource.com/kb/apparel-add-on?hsLang=en)
- [Upgrading ProductCart](https://productcart-kb.nsource.com/kb/upgrading-productcart?hsLang=en)
- [Change Logs](https://productcart-kb.nsource.com/kb/change-logs?hsLang=en)
- [Store Settings](https://productcart-kb.nsource.com/kb/store-settings?hsLang=en)
- [Security](https://productcart-kb.nsource.com/kb/security?hsLang=en)
- [Shipping Options](https://productcart-kb.nsource.com/kb/shipping-options?hsLang=en)
- [Payment Options](https://productcart-kb.nsource.com/kb/payment-options?hsLang=en)
- [Tax Options](https://productcart-kb.nsource.com/kb/tax-options?hsLang=en)
- [Advanced Technical Articles](https://productcart-kb.nsource.com/kb/advanced-technical-articles?hsLang=en)
- [Pages](https://productcart-kb.nsource.com/kb/pages?hsLang=en)
- [What's New In ProductCart](https://productcart-kb.nsource.com/kb/whats-new-in-productcart?hsLang=en)
- [Marketing](https://productcart-kb.nsource.com/kb/marketing?hsLang=en)
- [How To's](https://productcart-kb.nsource.com/kb/how-tos?hsLang=en)
- [Google Analytics](https://productcart-kb.nsource.com/kb/google-analytics?hsLang=en)
- [QuickBooks Sync](https://productcart-kb.nsource.com/kb/quickbooks-sync?hsLang=en)
- [Default](https://productcart-kb.nsource.com/kb/default?hsLang=en)
- [Configurator](https://productcart-kb.nsource.com/kb/configurator?hsLang=en)
- [SEO](https://productcart-kb.nsource.com/kb/seo?hsLang=en)
- [Mobile Commerce](https://productcart-kb.nsource.com/kb/mobile-commerce?hsLang=en)
- [Troubleshooting](https://productcart-kb.nsource.com/kb/troubleshooting?hsLang=en)
- [Customizing Your ProductCart Store](https://productcart-kb.nsource.com/kb/customizing-your-productcart-store?hsLang=en)
- [ProductCart Apps](https://productcart-kb.nsource.com/kb/productcart-apps?hsLang=en)
- [Hidden Topic](https://productcart-kb.nsource.com/kb/hidden-topic?hsLang=en)
- [Reports and Exports](https://productcart-kb.nsource.com/kb/reports-and-exports?hsLang=en)

[![ProductCart Logo](https://productcart-kb.nsource.com/hs-fs/hubfs/pc_logo.png?width=200&height=93&name=pc_logo.png "ProductCart Logo")](https://netsourceinc.com)

NetSource Commerce, Inc. **|** Headquarters - 3700 South Pine Avenue, Ocala, FL 34471 **|** Tel [(800) 709-3240](tel:+8007093240) **|** Fax (352) 401-0353

<https://www.facebook.com/productcartsoftware> <https://x.com/productcart?s=20> <https://www.linkedin.com/company/productcart/> [mailto:help@productcart.com](mailto:help@productcart.com)

Copyright © 2026, NetSource