私はCraft CMSで新しく、あなたの誰かが私を少し助けてくれることを願っています。
現時点では私のブログからすべてのエントリーを
{% paginate craft.entries.section('blogItem').limit(globalSettings.postsPerPage) as pageActive, pageEntrys %}
実際に私は1つのレベルで5つのカテゴリ(catA、catB、catC、catD、catE)を持っていますが、今は別のカテゴリNrを持っています。
(catF) 5つすべてのカテゴリがブログページに表示されますが、catFサウンドは別のページ(pageF)に表示されます。
blogFageでcatFからすべてのエントリを非表示にして、これらのエントリをpageFで表示する方法はありませんでした。
あなたの4つの助け。 smueller
ベストアンサー
私たちの議論に基づく新しい答え:
<!-- Step 1. get the category you want to exclude
since I still don't know your structure I'll just grab it
per id. You can see that in your cp edit url (the last number) -->
{% set category = craft.categories.id(108).first() %}
<!-- Step 2. get all entryIds related to that category -->
<!-- this should be an array of ids you can dump it to check them -->
{% set entriesInCategory = craft.entries.relatedTo(category).ids() %}
<!-- Step 3 exclude those ids from your last query -->
{% set entries = craft.entries.section('blogItem').id('and, not ' ~ entriesInCategory|join(', not ')) %}
<!-- just for debugging and testing if these are the correct one -->
{% for entry in entries %}
{{ entry.title }}
{% endfor %}
<!-- then you can use your paginate with those entries -->
古い投稿
カテゴリFに関連するすべてのエントリを取得し、クエリで除外できます
{% set catF = craft.categories.group('categories').ids() %}
{% set entriesForCatF = craft.entries({
relatedTo: catF,
}).ids() %}
{% set entriesNotInCategoryF = craft.entries.section('blogItem').id('and, not ' ~ entriesForCatF |join(', not ')).ids() %}
{% paginate craft.entries.section('blogItem').limit(globalSettings.postsPerPage).id('and, not ' ~ entriesNotInCategoryF |join(', not ')) as pageActive, pageEntrys %}