-
1. Re: What should nodes in content repository be named?
breakpoint Jan 8, 2014 4:12 PM (in response to breakpoint)I was lucky to chat with rhaush on IRC and I asked him the same question I did here basically.
What I was struggling with was how to name nodes. I used the example of storing questions in the content repository. I didn't know what to name the nodes. I thought using arbitrary ids was bad (but I don't know where I got that from). It isn't though. Not all nodes have a natural name that you could use. Ids are fine then. If I used the title as a node name I would run into naming collision. Two or more questions could have the same title. You could do something to help the situation by organising the nodes like this:
/questions/{year}/{month}/{date}/{title}
But this still mean that two questions added on the same day can collide. Instead I do this to prevent collision:
/questions/{year}/{month}/{date}/{id}
So to answer my own question: using ids are fine when a natural name is not available to use. You also want the repository structure of nodes to be hierarchical, so deeper rather than flat&wide, that is why the questions are organized under the date it is added (submitted).