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.

pulling from multiple weblogs not using same feilds?

February 13, 2009 9:11am

Subscribe [2]
  • #1 / Feb 13, 2009 9:11am

    Martin_Fuel

    8 posts

    I have a section on a site that I am working on which pulls from more than one weblog like below

    {exp:weblog:entries weblog="news|events"}
    
    <div class="post">
      <h3>{title}</h3>
    <p>  <span class="date">{entry_date format="%d of %M , %Y"}</span><br />
      ...<br />
    </div></p>
    
    <p>{/exp:weblog:entries}

    What I want to do is only display entry_date if it is part of the news weblog and if it is an event, pull from another custom field called event_date.

    Does anyone know if this is possible?

    Thanks a lot in advance, Martin

  • #2 / Feb 13, 2009 9:22am

    e-man

    1816 posts

    Assuming that the news weblog does not have an {event_date} field then this should do it:

    {exp:weblog:entries weblog="news|events"}
    <div class="post">
      <h3>{title}</h3>
    <p>  <span class="date">{if event_date}{event_date}{if:else}{entry_date format="%d of %M , %Y"}{/if}</span><br />
      ...<br />
    </div></p>
    
    <p>{/exp:weblog:entries}

  • #3 / Feb 13, 2009 9:34am

    Martin_Fuel

    8 posts

    Thanks a lot! didnt realise it would be so simple 😊

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

ExpressionEngine News!

#eecms, #events, #releases