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.

display 2 channel entries in order by date

January 22, 2011 1:25pm

Subscribe [4]
  • #1 / Jan 22, 2011 1:25pm

    Eastwood Design

    605 posts

    This works in a 1.6 EE install, but not working in EE 2

    any ideas why not?

    <h2>News and Events</h2>
    <p>{exp:channel:entries channel="events|News" limit="10" sort="asc" show_future_entries="yes" show_expired="no"} <br />
    {if channel == "events"}<br />
    {entry_date format="%D, %M %d, %Y - %g:%i%A"} - <strong>{title}</strong><br />
    {if events_desc}<a href="http://{title_permalink=">[more]</a>{/if}</p>
    
    <p><br />
    {/if}</p>
    
    <p>{if channel == "News"}<br />
    {entry_date format="%D, %M %d, %Y - %g:%i%A"} - <strong>{title}</strong><br />
    {if news_body}<a href="http://{title_permalink=">[more]</a>{/if}</p>
    
    <p><br />
    {/if}<br />
    {/exp:channel:entries}<br />
    <a href="#"> View All </a>

  • #2 / Jan 23, 2011 6:10pm

    Greg Salt

    3988 posts

    Hi Eastwood Design,

    Can you clarify exactly what it is that is not working? What do you expect to happen and what is actually being displayed? Which version and build of EE are you using?

    Cheers

    Greg

  • #3 / Jan 24, 2011 8:53am

    Eastwood Design

    605 posts

    I have 2 channels events and News.  I want the entries to be displayed in order of date. 

    Right now NOTHING is being displayed.

    EE 2.1 Build:  20101020

  • #4 / Jan 24, 2011 9:01am

    Eastwood Design

    605 posts

    If I separate the 2 channels they are displayed fine.  ie:

    <h2>Upcoming Events</h2>
    <p>{exp:channel:entries channel="events" limit="10" sort="asc" show_future_entries="yes" show_expired="no"} </p>
    
    <p>{entry_date format="%D, %M %d, %Y - %g:%i%A"} - <strong>{title}</strong><br />
    {if events_desc}<a href="http://{title_permalink=">[more]</a>{/if}</p>
    
    
    
    <p><br />
    {/exp:channel:entries}<br />
    <a href="#"> View All </a>

    <h2>News</h2>
    <p>{exp:channel:entries channel="News" limit="10" sort="asc" show_future_entries="yes" show_expired="no"} </p>
    
    <p>{entry_date format="%D, %M %d, %Y - %g:%i%A"} - <strong>{title}</strong><br />
    {if news_body}<a href="http://{title_permalink=">[more]</a>{/if}</p>
    
    
    
    <p><br />
    {/exp:channel:entries}<br />
    <a href="#"> View All </a>

  • #5 / Jan 24, 2011 4:13pm

    Ingmar

    29245 posts

    I don’t see what that shouldn’t work. What version of EE2 are you using? Do you’ve got any extensions or other third-party add-ons installed?

  • #6 / Jan 24, 2011 4:15pm

    Eastwood Design

    605 posts

    I don’t see what that shouldn’t work. What version of EE2 are ylou using? Do you’ve got any extensions or other third-party add-ons installed?

    EE 2.1 Build:  20101020

    only using Wygwam

    Thanks
    Peter

  • #7 / Jan 25, 2011 10:17am

    Sue Crocker

    26054 posts

    Hi, Peter.

    What happens if you put this code in it’s own template, nothing else in it?

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

ExpressionEngine News!

#eecms, #events, #releases