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.

Using one template for a single weblog entry as well as a list

July 19, 2009 7:48pm

Subscribe [2]
  • #1 / Jul 19, 2009 7:48pm

    imustbuild

    1 posts

    I’m trying to build out a weblog for a news section and i’d like it to work like this:

    my-site/news/  = a list of all news weblog entries, with pagination

    my-site/news/my-article/  = a single entry


    I started off with an if statement that said if segment_3 == “” show the list, but that all fell apart when I introduced the pagination. I’d have to think I’m just missing something because adding OR if segment_3 == “P1” and so on sounds ridiculous.

    Can anyone share any code samples of how to make this work without making the url more complex?

    Thanks,
    Marc

  • #2 / Jul 20, 2009 3:02am

    Ingmar

    29245 posts

    That’s exactly how EE handles things out of the box, as it were, if you make use of its dynamic features. Just create the “index” template, if there is something in segment_3 EE will automatically display this entry only. Makes sense?

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

ExpressionEngine News!

#eecms, #events, #releases