I'm currently evaluating Statamic to replace the CMS at my university. I'd like to start off with the following disclaimer/info:

  1. I am completely new to Statamic, and Laravel
  2. I do have 10+ years of experience with WordPress
  3. This is the most extreme edge case I think we have. Everything else is a piece of cake.

Conceptually speaking I know exactly what I need to do, but I am not sure how to achieve what I need to replicate with our current set up with Statamic. I am also extremely rusty with PHP.

We have a main blog page / archive that has three blog entries at the top that can come from any of four main 'topic' categories. Below this, we have a row of four columns for each topic with three entries shown within each topic category.

The top three entries can come from any of one of the four categories (all from one, or all of them from different categories). These top three entries should never show in the bottom row for the four topics. So I need to be able to create a conditional offset for each of the four bottom topic categories to handle if all three, one or two, or none, of the top three posts have already been shown as a part of the current group of four topics.

I did ask in the help channel in Slack, but due to my complete lack of experience with both Statamic and Laravel, I am unable to figure this out. I have tried all kinds of things but can't seem to make any headway on this. I do not know how to grab the IDs of the entries and pass them on for exclusion. I don't understand how to access the entries' data structure to get to the data values. Sorry if this seems obtuse on my end, but I just don't know how I handle the data here and I didn't see any examples of how to grab an entry's id in this way. If it is there, I have missed it.

Thanks in advance for any assistance provided.

namespace Statamic\Addons\BlogTopicOffset;

use Statamic\Extend\Filter;
use Statamic\API\Entry;
use Statamic\API\Collection;

class BlogTopicOffsetFilter extends Filter
{
    /**
     * Perform filtering on a collection
     *
     * @return \Illuminate\Support\Collection
     */
    public function filter()
    {

      // NEED TO GET 3 NEWEST BLOG ENTRIES TO BUILD ARRAY OF EXCLUSION IDS
     // NOT SURE WHAT TO CALL HERE TO CREATE $exclude_ids

      return $this->collection->filter(function ($entry) {

        if (!in_array($entry->ID, $exclude_ids))
          return $entry;
      });

    }
}