Create URL-friendly slugs?

Options

I'm in the middle of creating a function stack that grabs a number of items and mashes them all together to make a URL slug for my site. Here is a sample:

That works great for that particular item, but when looking through my product table I'm seeing a lot of MDN (model numbers) that use characters like spaces & periods. Here are some examples:

  • Pro MP242C
  • UM.QP1AA.P01
  • 24HC1QR Pbidpx
  • E278B-QPN168+
  • Dell S2522HG - 1J0VT
  • 2V6B2AA#ABA

It would be nice to have the MDN as part of the URL slug for SEO purposes, but if the solution to this is overly complicated, might be worth skipping this.

Is there by a chance an easy way to auto encode stuff like this into URL-friendly formats?

Comments

  • Brandon Hassler
    Brandon Hassler Member
    edited June 2023
    Options

    Of course right after I post this I tried out the "url_encode" filter 🤦‍♂️ That (I think) solves it! Xano always 5 steps ahead of me.