Generate slugs from related HasSlugs models #862
Unanswered
kirkbushell
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One issue I found immediately while trying to work on the frontend is ... how the hell do I generate slugs for nested modules and/or related modules? Ie. If I setup an Article module, and a Category module, and an Article belongs to a category, how on earth would I do that?
The solution seems relatively simple: in the getSingleSlugParams on the HasSlug trait, we can check the fetched "attribute" to see if it's a model, and if it is, and that model also HasSlug, then call getSingleSlugParams on that.
What do we think about this particular solution?
Beta Was this translation helpful? Give feedback.
All reactions