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.

Site Hierarchy Question

September 11, 2011 10:46pm

Subscribe [3]
  • #1 / Sep 11, 2011 10:46pm

    JREAM

    16 posts

    I am wondering how you build a hierarchy, I’ve played with Categories and I’m a bit lost, because you can check many of the categories during Publishing.

    Overview:
    1: I have a template called ‘Site’, which will apply to almost every page.
    2: I want a sub-section called ‘Lab’, so it would appear on my webpage like this:

    - Home
    -- /Lab
    ---- /API (Another page under lab, sharing the site template possibly)
    ---- /Other (Another page under lab, sharing the site template possibly)
    - Contact

    Q: Do I have to create a template for Lab even if it uses the same Site template?

    Q: If I do NOT have to create a template for every sub-section, how would I tell the Site/Index file to load the home page when it does not have a URL, and how does it know what page to load?

    Is it something like this:

    {if segment_1 == ""}
      {exp:channel:entry channel="site" entry_id="1"}
        Q: Should a Fixed entry ID be here for the home page?
        {title}
        {site_body}
      {/exp:channel:entry}
    {else if segment_2 == "lab"}
      {exp:channel:entry channel="site_lab" limit="1"}
        Q: Should I have a separate channel for a sub-section like Lab?
        Q: But how do I know this would load the right channel? 
        {title}
        {site_body}
      {/exp:channel:entry}
    {else}
      {exp:channel:entry channel="site" limit="1"}
        Some other default page thing
      {/exp:channel:entry}
    {/if}

    Does this make sense what Im trying to do?

  • #2 / Sep 11, 2011 11:43pm

    alexmglover

    47 posts

    You can use the Pages module to create the page hierarchy and set the templates for each page.

  • #3 / Sep 11, 2011 11:45pm

    JREAM

    16 posts

    awesome thanks 😊

  • #4 / Sep 11, 2011 11:46pm

    alexmglover

    47 posts

    You’re welcome.

  • #5 / Sep 12, 2011 2:29am

    John Henry Donovan

    12339 posts

    Thanks Alex. Closing this out for you JREAM. If you have further questions feel free to start a new thread

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

ExpressionEngine News!

#eecms, #events, #releases