从静态块链接到类别的最佳方法
从静态块链接到类别和产品的最佳方式是什么?
我问这个问题是因为有时我们会更新类别等的 URL 键,这会破坏静态块中到给定类别和产品的链接。
有没有更好的方法使用 ids 等进行链接,以便无论 seo 友好的 url 是什么,链接都将处于活动状态?
目前,我使用的链接如下: link
当类别的 URL 更改时,上述链接将被破坏。
What is the best way to link to categories and products from static blocks.
I ask because sometimes we will update URL-keys for categories, etc, which will break links in static blocks to given categories and products.
Is there a better way to link using ids etc so the links will be active regardless of seo-friendly urls?
Currently, I use links such as:<a href="store.com/generators/generators.html?"generator_package=6>link</a>
When the urls for the categories change the above link would be broken.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个怎么样?让我知道结果,也许我们可以采取其他方法。
+++ 编辑 - 新代码示例 +++
首先创建一个静态块,该块应该引用一个 phtml 文件,您可以将逻辑放入该文件中。
在 /app/design/frontend/[YOUR_THEME]/template/catalog/category/ 目录中创建 ListCategory.phtml。
How about this? Let me know the result, maybe we can handle other ways.
+++ EDIT - New Code Sample +++
First create a static block which is this block should reference a phtml file that you can put your logic into this file.
Create ListCategory.phtml in the /app/design/frontend/[YOUR_THEME]/template/catalog/category/ directory.