Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

How to get only translated pages in collection?

Solved by Javi View solution

Started by Javi 8 years ago · 5 replies · 1109 views
8 years ago

Hi all!

Is possible get only the translated pages in collections? I have a lot of posts that not are translated in english but in the english collection page (Blog) they appears in the default lang (Spanish)

Thanks

8 years ago

@javiregpa Not sure if this will do what you want, but I recall the following related setting in '/user/config/system.yaml':

YAML
languages:
  translations_fallback: true     # Fallback through supported translations if active lang doesn't exist

Try setting it to false and see if it works.

8 years ago

@pamtbaau:
all the following related setting i

hI @pamtbaau

I have translations_fallback set to false, but also shows the posts although they are not translated in English.

This is my blog.en.md

YAML
---
title: News
slug: news
body_classes: blog_classic
content:
    items: '@self.children'
    limit: 10
    order:
        by: publish_date
        dir: desc
    pagination: true
    url_taxonomy_filters: false
---

# NEWS AND EVENTS
##### CORPORATE NEWS

Thanks

8 years ago Solution

I found a "solution"

Yo need to translate the page in the others languages and after set unpublished this pages, in the collection page don't appear the unpublished pages.

Thanks

👍 1
8 years ago

Nice find! Thanks for sharing your solution...

👍 1
8 years ago

Thanks for your help @pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Support · by gravinator, 1 month ago
5 453 2 hours ago
Support · by stell, 7 days ago
4 238 5 days ago
Support · by Gravver, 2 weeks ago
6 280 1 week ago
Support · by Marcel, 4 weeks ago
2 338 1 week ago
Support · by blu3prince, 2 weeks ago
1 255 2 weeks ago