You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if items exist: add "-" + number to the slug --> myslug-1
repeat check with new slug. increase number if necessary and repeat again...
Maybe you can check if the slug field has been set to unique in Directus and only apply the "makeUnique" function then. So is is more flexible if so users for some reason need multiple items with the same slug. But I think that would be pretty cool.
The text was updated successfully, but these errors were encountered:
If there are two items in a collection with the same values which are used in the template input the resulting slug is also the same.
But a slug should be unique.
The WP function (docs here: https://developer.wordpress.org/reference/functions/wp_unique_term_slug/)
Maybe you can check if the slug field has been set to unique in Directus and only apply the "makeUnique" function then. So is is more flexible if so users for some reason need multiple items with the same slug. But I think that would be pretty cool.
The text was updated successfully, but these errors were encountered: