Question

I'm working on a project where we're migrating content out of an Expression Engine (EE) site, and I'm trying to get my head around EE's programatic routing logic and database relation structure. I've never used Expression Engine before.

Is there a way to programmatically determine what URLs a piece of content is available at?

From what I've gathered, EE's URLs look like this

http://example.com/index.php/template-group/template-name/slug

The slug identifies a piece of a content, and EE uses the first two parts of the URL (template-group/template-name). What's unclear to me is how (if at all) the system decides which template groups and templates to use for a particular piece of content.

Was it helpful?

Solution

By default (ie, without any addons or third-party code running to change the routing, and without the native Pages module or the third-party Structure module installed), the first segment of a URI will always call a template group and the second segment will call a template within that group. So if I have, say:

http://www.example.com/group1/my-awesome-thing

ExpressionEngine will look inside group1 for a template called my-awesome-thing, and render whatever is in that template.

If that template contains an {exp:channel:entries} loop that does not have dynamic="no" specified, EE does some further magic and checks the URI -- is the third segment a slug or the reserved category word? are there pagination or archive segments? -- and displays content accordingly. There's more things that the builtin route parser does, as well: James Smith created a great schematic, which can be found here: http://www.jamessmith.co.uk/articles/expressionengine_url_schematic

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top