douxie7339 2013-10-29 17:30
浏览 28
已采纳

什么将表达式引擎条目与模板/ URL路由联系起来

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.

  • 写回答

1条回答 默认 最新

  • douqie6454 2013-11-01 02:28
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle触发器记录修改前后的字段值
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器