Okay so on my Homepage I want to pull out 3 lists of news items; major news, featured news and news headlines. There should only be one item shown under the Major News heading at a time and any other entries that are flagged as such will filter back into featured news list.
My problem is capturing the entry_id of the 'one' major news item and excluding it from the featured list. The major news item might not always be latest news item so that rules out using offset="1".
So I put together some Stash sets that filter out the news based on the custom field (cf_news_article_type). cf_news_article_type is a list of 3 radio buttons that the user sets when adding a news item. The values of the fields are set up as follows:
mj : Major Feature
gf : Featured Article
gn : General article
I stash a set of 13 news items from all types:
{!-- Bring out all the recent news --}
{exp:channel:entries channel="news" orderby="date" sort="desc" dynamic="no" limit="13" parse="inward" disable="categories|category_fields|member_data|pagination|trackbacks"}
{exp:stash:append_list name='recent_articles'}
{stash:item_count}{count}{/stash:item_count}
{stash:item_type}{cf_news_article_type}{/stash:item_type}
{stash:item_title}{title}{/stash:item_title}
{/exp:stash:append_list}
{/exp:channel:entries}
Then later in my template I pull out the major news item:
<article class="major-feature">
{exp:stash:get_list name="recent_articles" match="#mj#" against="item_type" limit="1" parse_tags="yes"}
{sn_news_story}
{/exp:stash:get_list}
</article>
Now the big question: how can I exclude that single major news item from the featured news list, but keep the other items flagged 'mj' when I get the featured Stash list?
<section class="featured-stories">
<h1>Featured stories</h1>
{exp:stash:get_list name="recent_articles" match="#(mj|gf)#" against="item_type" limit="3" parse_tags="yes"}
{sn_news_story}
{/exp:stash:get_list}
</section>
Then for my headlines I'd love to exclude all the featured and Major news items that are shown in these two lists, but I will tackle that one in another post I think.
Is this even the correct approach for doing such a thing? Any help would be greatly appreciated.