ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

What controlls what template is used?

June 21, 2011 7:41am

Subscribe [4]
  • #1 / Jun 21, 2011 7:41am

    RDF Group

    11 posts

    Im learning EE from some screencasts. In a template group I have the templates index, show and view. What controlls which template is used by a page, and what controlls what template group is used?
    Thanks

  • #2 / Jun 21, 2011 11:28am

    Boyink!

    5011 posts

    It’s all controlled by the URL.  If EE sees a URL with a correct template group name it starts looking there:

    http://mysite.com/index.php/about/ - EE looks for a template group named “about”.

    http://mysite.com/index.php/about/our-building - Now EE looks for a “our-building” template in the about template group. If it doesn’t find one it falls back to displaying the about/index template assuming there is an entry with the url-title of our-building./

    Unless you tell EE otherwise by setting the “dymamic=“no” parameter everywhere it’s all URL driven.

    URL’s cause EE to pull templates, or entries into templates.  You code templates to control what content EE pulls from it’s database to push through a template to become a final rendered page.

  • #3 / Jun 21, 2011 11:34am

    RDF Group

    11 posts

    Thanks

  • #4 / Jun 21, 2011 12:23pm

    RDF Group

    11 posts

    So is the only reason for creating more than 1 template group to control the url? If you weren’t concerned about the url output could you just use 1?

  • #5 / Jun 21, 2011 12:31pm

    Boyink!

    5011 posts

    You could. I did on my first EE sites.  But there’s no penalty for using more template groups, it keeps your templates more organized, and cleaner URLs to boot.

  • #6 / Jun 22, 2011 4:24am

    John Henry Donovan

    12339 posts

    RDF Group,

    Does Mike’s last answer clear everything up for you here or do you have further questions?

  • #7 / Jun 22, 2011 5:44am

    RDF Group

    11 posts

    Yes, all cleared up, thanks. In future should I post a comment saying so?

  • #8 / Jun 22, 2011 11:59am

    Sue Crocker

    26054 posts

    Hi, RDF Group.. if you post that your issue has been solved, you could either say so in the post, or edit the topic to say [SOLVED] before the title of the post. It makes it easier to close threads.

    If anything else comes up, please do let us know in a new thread..

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases