ee-garage.com

Group entries by author

Outputs a list of all channel entries grouped by the entry's author_id value.

// Input template tag-data
{exp:nsm_channels:group_entries_by
  group_by="author_id"
}
  <h3>{author}</h3>
  <ul>
  {channel_entries}
    <li>
      #{entry_id} - {title}
    </li>
  {/channel_entries}
  </ul>

{/exp:nsm_channels:group_entries_by}
// Output HTML
  <h3>John Doe</h3>
  <ul>
    <li>#1 - Test channel entry</li>
    <li>#2 - Another test channel entry</li>
  </ul>

  <h3>Jane Doe</h3>
  <ul>
    <li>#3 - Yet another test channel entry</li>
    <li>#4 - This is the last test channel entry</li>
  </ul>

Group entries by date

Outputs a list of all channel entries grouped by the entry_date year and month. Because a format has been added to the group_by parameter the channel entries will be grouped according to the outcome of the parsed entry date.

// Input template tag-data
{exp:nsm_channels:group_entries_by
  group_by="entry_date format='%Y, %M'"
}
  <h3>{entry_date format='%Y, %M'}</h3>
  <p>{channel_entries_total_results} entries</p>
  <ul>
  {channel_entries}
    <li>
      #{entry_id} - {title}
    </li>
  {/channel_entries}
  </ul>

{/exp:nsm_channels:group_entries_by}
// Output HTML
  <h3>2011, Nov</h3>
  <p>2 entries</p>
  <ul>
    <li>#1 - Test channel entry</li>
    <li>#2 - Another test channel entry</li>
  </ul>

  <h3>2011, Dec</h3>
  <p>1 entries</p>
  <ul>
    <li>#3 - Yet another test channel entry</li>
  </ul>

  <h3>2012, Jan</h3>
  <p>1 entries</p>
  <ul>
    <li>#4 - This is the last test channel entry</li>
  </ul>
Releases RSS Feed © Copyright 2017 | Policies All prices shown are in Australian Dollars ($AUD) Newism