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.

Single entry per page - recommended setup?

February 01, 2011 1:09pm

Subscribe [3]
  • #1 / Feb 01, 2011 1:09pm

    upshot

    85 posts

    Hey all,

    Noob here.  We are trying to wrap our heads around the best way to build out this site that we have.  It’s essentially 50 - 60 pages and each page would display just one entry.  From what I can tell this means we need to utilize the Channel Entries tag as such:

    {exp:channel:entries channel="news" limit="1"}

    The problem is that I’m not aware of a way to dynamically populate the “channel” parameter.  Is there any way to pull this in dynamically?  I’m thinking the only way is to pass the channel name into the URL and parse it that way?

    Also, with this setup is it really required that we create a new channel every time we create a new page?

  • #2 / Feb 02, 2011 8:07am

    Sue Crocker

    26054 posts

    Hi, upshot. There are many ways to approach this. EE isn’t really a page based CMS, but you can have it act that way if needed.

    You’d create a single entry page for each channel, not one per entry.

    Say you wanted to have an About Us page and a Terms of Use page.

    You’d create a channel called info (just a suggestion, you don’t need to call it that) and make two entries called About Us and Terms of Use.

    You’d then make a template called news/info and pass in the name of the url_title.

    So the url would be: http://example.com/index.php/news/info/about_us

    -or-

    http;//example.com/index.php/news/info/terms_of_use

    The news/info template would “see” the third segment about_us or terms_of_use and grab the information based on the url_title.

    You could use the second segment to make it more dynamic.

    Here’s an example of the template:

    {exp:channel:entries channel="{segment_2}" limit="1"}
    ...
    {/exp:channel:entries}

    This is a very basic way of handling things. You might also want to take a look at: The Importance of Semantics written by Lisa Wess.

    Does that help?

  • #3 / Feb 02, 2011 10:09am

    upshot

    85 posts

    Perfect!  Thanks so much for acting as a light to show us the way.  😊

  • #4 / Feb 02, 2011 5:07pm

    Ingmar

    29245 posts

    Glad to see that helped. Please post again in case there’s anything else.

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

ExpressionEngine News!

#eecms, #events, #releases