I'm thinking about the URL structure for a new site. I'm trying to balance two forces:
1. a proper nested hierarchy of URL elements, organised by a single relationship type, for example
http://example.com/contains/section1/section1p1/section1p1p1
2. a single page javascript app that navigates them, individually or in groups, for example
http://example.com/contains/#section1/section1p1/section1p1p1
I think the solution is a moveable hash and a JS redirect.
URL | Content |
---|---|
http://example.com/contains/section1/section1p1/section1p1p1 | Section 1.1.1 specifically |
http://example.com/contains/section1/section1p1 | Section 1.1 and all its subsections in summary |
http://example.com/contains/section1 | Section 1 and all its subsections in summary |
We need this tightly defined URL structure to clearly present the data to search engines. However we want to allow the js app to present dynamic views, where the user can choose the level of detail displayed under each level of the hierarchy, so it needs to be able to do some narrowing too.
URL | Content |
---|---|
http://example.com/contains/section1/section1p1/#section1p1p1 | Section 1.1, but dynamically narrow down to section 1.1.1. |
.../contains/section1/#section1p1/section1p1p1 | Section 1 and all its subsections, but control how we summarise those subsections (section 1.1.1 currently selected) |
.../section1/#section1p1[as=scatter_y]/section1p1p1[as=scatter_x] | Section 1 and all its subsections as a scatter diagram. |
Here we've added parameters on each level of the hierarchy to specify how that level is viewed. The web currently (largely) presents a single view per URL. I'm interested in presenting multiple views per URL, where each is selectable as a hash parameter.