简体   繁体   English

如何删除 SAP Commerce / Hybris 中的 url 属性?

[英]How to remove url properties in SAP Commerce / Hybris?

Our SAP Commerce / Hybris shop has the following url properties at the product detail page: ?siteUid=test&siteName=test-Onlineshop&metaRobots=index%2Cfollow&multiDimensionalProduct=true我们的 SAP Commerce / Hybris 商店在产品详细信息页面上具有以下 url 属性: ?siteUid=test&siteName=test-Onlineshop&metaRobots=index%2Cfollow&multiDimensionalProduct=true

Is it possible to hide them, without breaking the shop?是否可以在不破坏商店的情况下隐藏它们?

I think Hybris OOTB doesn't have mentioned query parameters included in the product URL, so I don't know how it's been used in your project and how you form the URL.我认为 Hybris OOTB 没有提到产品 URL 中包含的查询参数,所以我不知道它是如何在您的项目中使用的,以及您是如何形成 URL 的。 But yes, you can get rid of it if you know its use cases.但是,是的,如果你知道它的用例,你就可以摆脱它。

say, If you are using these attributes on the storefront to render the data/page, you can send these attributes as a model attributes or part of a product data object.例如,如果您在店面使用这些属性来呈现数据/页面,您可以将这些属性作为 model 属性或产品数据 object 的一部分发送。

eg model.addAttribute("multiDimensionalProduct", TRUE);例如model.addAttribute("multiDimensionalProduct", TRUE); You can add those attributes in ProductPageController or before view controller or anywhere in the filter chain where it's available.您可以在 ProductPageController 或视图 controller 或过滤器链中可用的任何位置添加这些属性。 you can get its value using ${multiDimensionalProduct}您可以使用${multiDimensionalProduct}获得它的价值

If you have any use case for serverside, you can store/get attributes from a session.如果您有任何服务器端用例,您可以从 session 存储/获取属性。 For instance, in your given URL you can easily get siteUid & SiteName from the session site (cmsSite) object.例如,在您给定的 URL 中,您可以轻松地从 session 站点 (cmsSite) object 获取 siteUid 和 SiteName。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM