# How to use custom field in Shopware 5 item url?

**URL:** <https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619>\
**Category:** International (English Only)\
**Created:** [15. September 2020 um 16:52 UTC](https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619 "2020-09-15T16:52:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![davit\_sargsyan](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@davit\_sargsyan](https://forum.shopware.com/u/davit_sargsyan)\
**Post date:** [15. September 2020 um 16:52 UTC](https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619/1 "2020-09-15T16:52:20Z")

</div>

I am trying to use a custom field’s value in seo url template in shopware but it does not seem to work.

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:

```
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}
```

---

<div class="post-metadata">

**Author:** ![NextMike](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@NextMike](https://forum.shopware.com/u/NextMike)\
**Post date:** [16. September 2020 um 11:08 UTC](https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619/2 "2020-09-16T11:08:38Z")

</div>

Did you generate the URLs?

> **[Shopware 5 - Settings - cache / performance-module](https://docs.shopware.com/en/shopware-5-en/settings/cache-performance-module)**

---

<div class="post-metadata">

**Author:** ![davit\_sargsyan](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@davit\_sargsyan](https://forum.shopware.com/u/davit_sargsyan)\
**Post date:** [16. September 2020 um 11:12 UTC](https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619/3 "2020-09-16T11:12:38Z")

</div>

@NextMike‍ yes I did generate the SEO urls as well as cleared the cache several times. The custom field has a value for the product that I test, but it always seem to go to the else case.

When I debug the {$sArticle.custom\_url} in frontend template, it is shown there but I guess that it is not giving a value for the url. Any clues on that?

---

<div class="post-metadata">

**Author:** ![NextMike](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@NextMike](https://forum.shopware.com/u/NextMike)\
**Post date:** [16. September 2020 um 12:29 UTC](https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619/4 "2020-09-16T12:29:26Z")

</div>

To be sure use the standard attr1 - attr19 fields. Like that:&nbsp;{$sArticle.attr4}

---

<div class="post-metadata">

**Author:** ![davit\_sargsyan](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@davit\_sargsyan](https://forum.shopware.com/u/davit_sargsyan)\
**Post date:** [16. September 2020 um 12:39 UTC](https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619/5 "2020-09-16T12:39:45Z")

</div>

@NextMike‍ the usage of an if clause is also acceptable here, isn’t it?

---

<div class="post-metadata">

**Author:** ![davit\_sargsyan](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@davit\_sargsyan](https://forum.shopware.com/u/davit_sargsyan)\
**Post date:** [16. September 2020 um 12:42 UTC](https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619/6 "2020-09-16T12:42:46Z")

</div>

@NextMike‍ it worked with the attr1, do you have any idea why it didn’t work with a new custom field?

---

<div class="post-metadata">

**Author:** ![NextMike](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@NextMike](https://forum.shopware.com/u/NextMike)\
**Post date:** [16. September 2020 um 12:53 UTC](https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619/7 "2020-09-16T12:53:04Z")

</div>

I believe the fields are not available to the router. Just use the attr1-19. Yes, you can use all smarty commands.

---

<div class="post-metadata">

**Author:** ![davit\_sargsyan](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@davit\_sargsyan](https://forum.shopware.com/u/davit_sargsyan)\
**Post date:** [16. September 2020 um 12:59 UTC](https://forum.shopware.com/t/how-to-use-custom-field-in-shopware-5-item-url/69619/8 "2020-09-16T12:59:44Z")

</div>

@NextMike‍ thank you very much, that helped me a lot indeed.
