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.

{if individual_article} in weblog module?

July 27, 2007 2:38am

Subscribe [3]
  • #1 / Jul 27, 2007 2:38am

    trhaynes

    4 posts

    I expected to see a conditional tag like

    {if individual_article}
    in the weblog module so that I can display articles differently if I’m looking at a single article as opposed to a list of articles (either all articles or by category - I see on http://expressionengine.com/docs/modules/weblog/conditional_variables.html that there is a
    {if category_request}

    tag).

    Am I missing something?

    tom

  • #2 / Jul 27, 2007 10:48am

    PXLated

    1800 posts

    If I’m understanding correctly, couldn’t you use…
    {if total_results == "1"} Display this way {/if}
    {if total_results >= "2"} Display this other way {/if}

  • #3 / Jul 27, 2007 12:32pm

    trhaynes

    4 posts

    Not really ... you could still be looking at a list view but with only one item in it.  For example, when you go to the sports page, you see all the sports articles for today (usually lots).  Then when you click one, you see just that article.  But what if for one day there’s only one sports article - then you’d click into the sports section and for some reason you’d be in an article view ... it just wouldn’t be a good experience for the user.

    tom

  • #4 / Jul 27, 2007 12:53pm

    PXLated

    1800 posts

    Ahhhh.
    Out of curiosity…What are you trying to do, run both listings and single entry pages through the same template?

  • #5 / Jul 27, 2007 1:06pm

    trhaynes

    4 posts

    Yeah - if that’s not suggested then I can change it.  It’s the way that some CMSs (eg. Textpattern) are set up.

    Right now it’s still kinda magic to me as to how templates and URLs work.  I’ve thoroughly dissected the docs so am turning to human hints.

    I’ve got one template group called “site” which has an “index” template.  Right now this template is handling the homepage (mysite.com/index.php) as well as categories (with “section” as the category qualifier and URL category names turned on, so mysite.com/index.php/section/sports).  I’m not really sure how this is happening.  If I make a template called “article” and link my articles to mysite.com/index.php/article/article_name_here, will that work?

    tom

  • #6 / Jul 27, 2007 2:35pm

    PXLated

    1800 posts

    Right now it’s still kinda magic to me as to how templates and URLs wor

    Black Magic 😉

    Basically, EE looks at the URL and unless specified otherwise (dynamic=off parameter) will do some things automatically.
    If it sees a category ID or category name it displays only entries associate with that category.
    If it sees a P# it will paginate.
    If it sees an entry title it will only display that one entry.
    Those are normally in the third segment… http://www.site.com/index.php/templateGroup/template/segment3

    You can run everything through the same template but most find it easier to have a separate template for the single entry pages as you may want other things on that page…other fields displayed, comments, etc….that you wouldn’t on a multi-entry listing page. In the standard install templates it’s usually set up with two…the comments template being the single entry page.

    If I make a template called “article” and link my articles to mysite.com/index.php/article/article_name_here, will that work?

    You’d have to specify the templateGroup/template in that link.

    More Black Magic… You don’t have to specify those for your default index (even though you can) as EE will default to the index if nothing else is specified.

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

ExpressionEngine News!

#eecms, #events, #releases