Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

galleries with the same name. #23

Open
ingvi-zz opened this issue Dec 17, 2010 · 9 comments
Open

galleries with the same name. #23

ingvi-zz opened this issue Dec 17, 2010 · 9 comments
Labels

Comments

@ingvi-zz
Copy link

For some reason the slug for galleries with identical names are exactly the same. Check it out: http://magg.dottirandsonur.com/ (the gallery called SIMINN share the same name, and also same slug).

Should I do something different?

ingvi

@thomcowell
Copy link
Owner

Hi ingvi,

Unfortunately at the moment there is no code to check for duplicate gallery names or slugs. The way around it is to moment is give each gallery a unique name at a given depth in the structure. I will need to think about a fix, but if do have one then please send me a pull request.

Thanks,
Tom

@ingvi-zz
Copy link
Author

Hi Tom,
Allright, would the quick fix to be able to link galleries via ID's in the view?

Instead of:
http://magg.dottirandsonur.com/projects/slug/
then use:
http://magg.dottirandsonur.com/projects/112/
or even:
http://magg.dottirandsonur.com/projects/112-slug/

Just a suggestion.
ingvi

@ingvi-zz
Copy link
Author

....ok what about when a gallery is created you create it with the slug = name + id? then this duplucation of slugs will never happen.

Just wondering where this slug is created is it in models/gallery.rb [def set_slug]?

best
ingvi

@thomcowell
Copy link
Owner

Sorry for the silence,
I will have to have a look, but the name + id solution is less than ideal from a presentation view and breaks the idea of clean url structures. The next best thing would be to have a validation that only allows one gallery of a given name.

@ingvi-zz
Copy link
Author

that's true regarding pretty urls.

What about search engines and bookmarks? If you have a slug called gallery/fancyslide and suddenly your client decides to change it to gallery/awesomeslide. then I guess the bookmark is broken. Seems like many are going with urls in this direction = gallery/#id-#galleryname. And then the id is used to get the correct gallery...

just a thought. :)

cheers
ingvi

@thomcowell
Copy link
Owner

Hi ingvi, I believe you found a genuine defect, the gallery should have a unique name for a same parent_id.

@thomcowell
Copy link
Owner

Sorry ingvi, did you manage to come up with a fix?

@ingvi-zz
Copy link
Author

I'm currently just creating gallery slugs with id names and I stopped validating the gallery names.

@thomcowell
Copy link
Owner

I guess, I should look at a gallery slug editor functionality for this bug

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants