We use a database collection to publish news items. Our news stories are presented on a dynamic page. When clicking on the link to our most recent news story, we get a link not found. The link is set by referencing the title field in our database and is working on other news stories. The link does clearly reference the title field differently, but I cannot figure out why. The issue is with the following page and the first news story. https://www.icirr.org/events-and-news
Thanks
A long, long, time ago, … I had the same problem. Cause was that the Title had changed in the mean time. The ref still holds the old string, thus cannot find the “new” title. Example:
First entry : boy likes girl (all well)
Second entry : edit: boys ikes girl (boom)
In order to prevent this, you should always ref with the only thing that is unique in the dataset, which is the _id. Looks horrible in tour URL, I know. A way around it: simulate a “slug”. So next to the title, you define a second field called “slug” and you copy the (first time, original) title into that field once and only once. Now, you always reference by that slug. This means that changes in title will not be reflected in the slug, but hey, it can always be found.
Ahh, I see. Thanks for the tip moving forward. Any suggestions for fixing the current article besides redoing the entry and creating a new one?