【问题标题】:clicking on sitemap should load category page and show description at top - NopCommece单击站点地图应加载类别页面并在顶部显示描述 - NopCommerce
【发布时间】:2016-08-04 06:12:04
【问题描述】:

默认情况下,我在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 on 的任何详细信息

CategoryTemplate.ProductsInGridOrLines.cshtml

如果页面是从站点地图加载的,则为页面。

谢谢大家

【问题讨论】:

    标签: c# .net asp.net-mvc-routing nopcommerce


    【解决方案1】:

    试试这个:

    <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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-28
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      相关资源
      最近更新 更多