Use URL Slug feature for my news bundle

Hey,

I try to use the URL Slug feature to get SEO friendly URLs for my news objects:
https://pimcore.com/docs/6.x/Development_Documentation/Objects/Object_Classes/Data_Types/Others.html#page_URL-Slug-experimental

Has anyone a full example of how to link to a news detail from my news list template?
Is there maybe an automatically generated route (news_detail) whom I give the objects’ slug as parameter?

And is it my job to create the slug value for example by using an object save hook and taking the url friendly news title?

Kind regards
Chris

Hi @schaetzle you can look for working implementation on demo site, which also uses urlSlug field in link generator to generate link. you can download demo site from https://github.com/pimcore/demo or have a look here:
https://github.com/pimcore/demo/blob/96ff2bca03aa4189b75a0858b7e1a084bdb28721/app/Resources/views/product/product_teaser.html.twig#L2

1 Like

Hi @dvesh3, thank you. Works pretty fine. Kind regards Chris