点击网站地图应该加载类别页面并在顶部显示描述-NopCommece

本文关键字:顶部 显示 -NopCommece 描述 地图 网站 加载 | 更新日期: 2023-09-27 18:00:58

我在CategoryTemplate.ProductsInGridOrLines.cshtml页面的<div class="category-description" (I want to add condition here for conditional css to make display block or none)>中添加了类别和子类别的描述以及条件css,默认情况下,当任何用户直接单击产品选项卡时,都会隐藏描述块。

我的下一步是,只有当user/bot使用网站地图中的链接来查看单击的页面时,才会在页面中显示类别的描述。即,仅当从网站地图的页面加载了任何类别时,才显示css。

我知道链接将在内部调用

分类法

内部存在

目录控制器

但不知道如何通过或设置任何条件,这样我就可以在的<div class="category-description" (I want to add condition here for conditional css to make display block or none)>中检查条件并更改css

CategoryTemplate.ProductsInGridOrLines.cshtml

呈现时的页面

请向我提供有关如何在上更改css的任何详细信息

CategoryTemplate.ProductsInGridOrLines.cshtml

页面,如果该页面是从网站地图加载的。

感谢所有

点击网站地图应该加载类别页面并在顶部显示描述-NopCommece

试试这个:

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

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