简体   繁体   English

如何在 Shopware 5 项目 url 中使用自定义字段?

[英]How to use custom field in Shopware 5 item url?

I am trying to use a custom field's value in seo url template in shopware but it does not seem to work.我正在尝试在 shopware 的 seo url 模板中使用自定义字段的值,但它似乎不起作用。

The guide here does the exact same thing what I do:这里的指南和我做的完全一样:

https://docs.shopware.com/en/shopware-5-en/settings/seo https://docs.shopware.com/en/shopware-5-en/settings/seo

SEO URLs item template: SEO URL 项目模板:

deal/{if $sArticle.custom_url}{$sArticle.custom_url}{else}{$sArticle.supplier|replace:'.':'' }-{$sArticle.name|replace:'.':'' }{/if}

Is there something wrong with this part?这部分有问题吗?

{if $sArticle.custom_url}{$sArticle.custom_url}{/if}

Here is what happened: I created a new custom field, added it as a variable in seo router settings, put a value in item's overview, then cleaned all the caches, but it was not going there.这是发生的事情:我创建了一个新的自定义字段,将其添加为 seo 路由器设置中的变量,在项目的概述中放置一个值,然后清除所有缓存,但它没有去那里。

As I understood the reason is that only attr1-attr19 are available to the router.据我了解,原因是路由器只有 attr1-attr19 可用。 When I tried with the attr1 it worked.当我尝试使用 attr1 时,它起作用了。

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

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