-1

I am adding description for categories and sub categories and a conditional css in the <div class="category-description" (I want to add condition here for conditional css to make display block or none)> in CategoryTemplate.ProductsInGridOrLines.cshtml page by default making the description block to hide when any user clicks on products tab directly.

My next step is to show the description of categories in the page only if the user/bot uses the links present in the sitemap to view the clicked page. i.e make the css display only if any category is loaded from sitemap's page.

I know that the link will internally call

Category method

present inside

Catalog controller

but not able to figure out how to pass or set any condition so that I can check for condition and change css in the <div class="category-description" (I want to add condition here for conditional css to make display block or none)> of

CategoryTemplate.ProductsInGridOrLines.cshtml

page while rendering

Please provide me with any details about how I can change css on

CategoryTemplate.ProductsInGridOrLines.cshtml

page if the page is getting loaded from sitemap.

Thanks All

Hina Khuman
  • 757
  • 3
  • 14
  • 41

1 Answers1

0

Try this:

<div class="category-description" @(Request.UrlReferrer == null || !Request.UrlReferrer.AbsolutePath.Equals("/sitemap") ? Html.Raw("style=\"display: none\"") : null)>

(duplicated from http://www.nopcommerce.com/boards/t/43521/clicking-on-sitemap-should-load-category-page-and-show-description-at-top.aspx)

mariann
  • 456
  • 2
  • 7