Hi @jyoti197,
Thank you very much for your response, this is awesome news!
So, what I meant by “resilient to reordering” is the ability to reorder the stories (or add/remove some) without modifying the anchor names of the already existing stories.
This mostly refers to an implementation where the automatically generated anchor name is the index of the story. Let’s say I have three stories right now:
– 313 -> Edict of Milan
– 449 -> Britannia is invaded by the Anglo-Saxons
– 476 -> The Western Roman Empire falls
If I want to redirect my visitors to the third story, I would create a link https://example.com/path/to/timeline/#timeline-3
But then if I end up adding a fourth story in between 313 and 449 (something like 379 -> Theodosius I becomes emperor), then all the subsequent stories’ anchor names have been shifted by 1 with #timeline-3 now referring to my 449 story.
Anyway, so automatically generating anchor names based on their index would be a bad idea as it would require never modifying the timeline or changing a lot of links every time I do.
A simpler approach would be to let the user manually add the anchor name. If we suppose the user makes each of them unique, it would be resilient to reordering or adding/removing stories. However it would be more work to set up.
In my situation, the best approach would be to slugify the story’s “Date / Custom Text.” Assuming each one is unique, it would also generate unique anchor names that allows adding/reordering/removing stories.
But I imagine some people might want to have the same “Date / Custom Text” for multiple stories, so maybe the very best option would be to have manual anchor names by default and then an option to automatically generate the anchor names using the the stories’ “Date / Custom Text” value.
Lastly, if multiple timelines are present in the same webpage, it would be useful to be able to append the generated anchor names with the whole timeline anchor name.
Here one example:
– First timeline (manual anchor name: timeline)
— First story (The date is 313 so the anchor name is timeline-313)
— Second story (The date is 449, anchor name is timeline-449)
— …
– Second timeline (manual anchor name: other-timeline)
— First story (The date is 28/1/1986, anchor name is other-timeline-28-1-1986)
— …
I believe even with manual stories anchor name, it should append this global timeline anchor name, that way the user doesn’t have to verify that the anchor is unique throughout multiple timelines on the same webpage.
In conclusion, I would be perfectly satisfied with manually added anchor names, but if you want to go the extra mile and adding a automated generation process, slugifying the “Date / Custom Text” for each story would be the best approach in my opinion.
Thanks again for your positive response, this is highly appreciated!