How to automatically replace %20 in dynamic routing so when you go to link it uses dash like /sycamore-den #5738
-
I ran across an issue where a name of a place would have a space in it, and when using dynamic routing Otherwise, I will store another column with a converted name for this. So the NAME column would have "Sycamore Den" and the URI_NAME column would have "Sycamore-Den" Any other ideas that would be better so I don't need to store another column? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I would create a slug and store and index that. The slugify function should be idempotent so you can then safely slugify the param before looking for it in the database. |
Beta Was this translation helpful? Give feedback.
I would create a slug and store and index that. The slugify function should be idempotent so you can then safely slugify the param before looking for it in the database.
https://www.npmjs.com/package/slugify