Ok, so on my homepage I want to pull out 3 news lists; basic news, news and news. There should be only one item that appears under the heading βTop Newsβ at a time, and any other posts marked as such will be filtered back to the list of favorite news.
My problem is to capture the entry_id of the main news event and remove it from the list. The main news item may not always be the last news item, therefore it eliminates the use of offset = "1".
So, I have compiled several Stash sets that filter out news based on a custom field (cf_news_article_type). cf_news_article_type is a list of three radio buttons that the user sets when adding a news article. Field values ββare configured as follows:
mj : Major Feature gf : Featured Article gn : General article
I put a set of 13 news 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 in my template I pull out the main news material:
<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 is: how can I exclude this single main news item from the list of selected news, but save the other items under the βmjβ flag when I get the list of marked lists?
<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 would like to exclude all the recognized and main news articles that are shown in these two lists, but I will solve this issue in another post, I think.
Is this even the right approach for this? Any help would be greatly appreciated.