metafizzy / flickity-hash

Select Flickity slides with links
11 stars 10 forks source link

Use hyphens instead of %20 in URL #4

Closed differenceclouds closed 5 years ago

differenceclouds commented 5 years ago

Thank you for this feature!! One issue: the urls start looking kinda messy if the Alt text has any spaces in it. (I am loading the alt text from user generated image title in CMS) Underscores or hyphens would be preferable to "%20"

differenceclouds commented 5 years ago

Hm I'm realizing this change might make more problems for myself when actually trying to link to individual images from another page....

differenceclouds commented 5 years ago

I'm using this as a solution: https://stackoverflow.com/questions/28977793/convert-spaces-to-dash-and-lowercase-with-php

<?php print (str_replace(' ', '-', strtolower($blob))); ?>
desandro commented 5 years ago

Hello! Its up to you to provide whatever string you want to use for id. A simpler solution might be to use numbers for any carousel cell, across all carousel instances. cell1, cell2, cell3 ....

differenceclouds commented 5 years ago

Ah, but you see, I need meaningful SEMANTICS! Thanks for the reply.