title: How to implement hierarchical cms sites?
body: <p>I'm coding a little learning CMS project and I've hit a brick wall that's stopping me to complete the next step. I know I should be taking KISS (Keep It Simple, Stupid) into account, but I think it would nice, to be able to group pages hierarchicaly.</p>
  
  <p>The problem is that I want page <code>[root]-&gt;fruits-&gt;tropical-&gt;bananas</code> to be accessible only from this url: <code>http://localhost/cms/fruits/tropical/bananas/</code>. What I came up with until now is that cms table has a parent field that points to its parent. The question is: How to parse uri adress and select a row from DB with as few queries/efficiently as possible?</p>
  
  <pre><code>Table structure:
  Id
  Slug
  ...
  ...
  ...
  ParentId
  </code></pre>
  
  <p>All help and advice is kindly accepted.</p>