Hi.
It is possible to show a certain number of posts, according to their category, in a given post, not including the one being viewed.
Example:

Thanks
Hi.
It is possible to show a certain number of posts, according to their category, in a given post, not including the one being viewed.
Example:

Thanks
Yes, but you'll need a custom template I suppose
https://learn.getgrav.org/17/content/collections
I am using a Gantry particle to display content from Grav. The particle specific code to define the page collection is this:
{% set attr_extra = particle.extra | attribute_array %}
{% set article_settings = particle.article %}
{% set filter = article_settings.filter %}
{% set sort = article_settings.sort %}
{% set limit = article_settings.limit %}
{% set start = limit.start + max (0, ajax.start | int) %}
{% set display = article_settings.display %}
{% set collection = grav.page.collection (
{
items: {'@ taxonomy.category': filter.categories | split ('')},
order: {by: sort.orderby, dir: sort.ordering},
url_taxonomy_filters: false
},
false) %}
{% set total = collection.count () %}
{% set pages = collection.slice (start, limit.total) %}
With this code I get this result:

You can see the same article on the cards below. I would like that in the article or main post, it does not appear in the lower list of cards.
I think you could filter current page out before these two lines
{% set total = collection.count () %}
{% set pages = collection.slice (start, limit.total) %}
But there might be a better way. I'm not familiar with Gantry
Hi.
The pages are already filtered before the lines you propose.
I have tried with @ self-siblings on the line:
items: { '@self.siblings': filter.categories | split (' ') }, and I have obtained the desired result, but for this, I must have the pages at the same level, not being able to apply this filter to all the pages of the site, regardless of the level at which they are.
Log in to reply.
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 1 | 8 | 55 minutes ago | ||
| 0 | 4 | 1 hour ago | ||
| 2 | 136 | 1 day ago | ||
| 1 | 93 | 1 day ago | ||
| 0 | 77 | 2 days ago |