ttbb Posted April 13, 2022 Share Posted April 13, 2022 hi there, i'm pretty new to processwire after switching to a more slim, less dependency affected and more customizable CMF after 15 years with drupal ? after some weeks with tests and with staring up a new project i didn't regret my switch ? currently i'm working on an art gallery website, in its core consisting of two pages types with their respective templates: artists and artworks.artworks are mandatory connected to an artists. the URLs are /artists/someArtistsName and /artworks/someArtworksTitle. for better readable (SEO) and semantic usable URLs i want to have the artworks URLs automatically rewritten to /artworks/someArtistsName/someArtworksTitle after an artwork page has been created. inside of the artworks template the artist lives in a field with page reference type. i did intensive research here in the forum and on the web but didn't find a solution. maybe there's module for this? or how can i do this by adding this to the artworks template (hooks?). my be the collective community knowledge can point me in the right direction? any help is appreciated very much! best from vienna / austria thomas Link to comment Share on other sites More sharing options...
bernhard Posted April 13, 2022 Share Posted April 13, 2022 Hi @ttbb welcome to PW and the community ? one solution would be to enable url segments on the template of /artworks page. https://processwire.com/docs/front-end/how-to-use-url-segments/ That means you'd have an url like /artworks/[artist]/[artwork] and you'd have the artist in $input->urlSegment1 and the artwork in $input->urlSegment2 Does that help? 1 Link to comment Share on other sites More sharing options...
ttbb Posted April 13, 2022 Author Share Posted April 13, 2022 thanks for this hint! ? in between i changed the whole site structure to a more logical tree approach with the artworks now forced to be children of an artist. that works very well now ? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now