getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.5k stars 1.4k forks source link

problem with blog type items ordering option #3803

Open simogeo opened 7 months ago

simogeo commented 7 months ago

Hi,

I have the following configuration in my blog.md file :

---
title: 'Les actualités'
blog_url: actualites
menu: Actualités
body_classes: 'header-lite fullwidth blogstyling'
bg_color: '#E85C5C'
slug: actualites
sitemap:
    changefreq: monthly
content:
    items: '@self.children'
    order:
        by: date
        dir: desc
    limit: '15'
    pagination: '1'
feed:
    description: 'Les actualités de la Fondation Geomanum'
    limit: 10
metadata:
    description: 'Suivre l''actualité de la Fondation Geomanum'
pagination: '1'
cache_enable: false
child_type: default
process:
    markdown: true
    twig: false
robots: index

---

But the order parameter is not working and the limit / pagination neither ... any Clue ?

See online : https://geomanum.org/fr/actualites

Thanks for your support

pmoreno-rodriguez commented 7 months ago

Hi. What theme are you using?

simogeo commented 7 months ago

Hi, I use hydrogen theme with Gantry 5

pmoreno-rodriguez commented 7 months ago

Are you using the default contentarray particle included with hydrogen or any other?

simogeo commented 7 months ago

I did not add anything myself, so I guess !

pmoreno-rodriguez commented 7 months ago

Hi,

I have the following configuration in my blog.md file :

---
title: 'Les actualités'
blog_url: actualites
menu: Actualités
body_classes: 'header-lite fullwidth blogstyling'
bg_color: '#E85C5C'
slug: actualites
sitemap:
    changefreq: monthly
content:
    items: '@self.children'
    order:
        by: date
        dir: desc
    limit: '15'
    pagination: '1'
feed:
    description: 'Les actualités de la Fondation Geomanum'
    limit: 10
metadata:
    description: 'Suivre l''actualité de la Fondation Geomanum'
pagination: '1'
cache_enable: false
child_type: default
process:
    markdown: true
    twig: false
robots: index

---

But the order parameter is not working and the limit / pagination neither ... any Clue ?

See online : https://geomanum.org/fr/actualites

Thanks for your support

This markdown code, is about your last image? The blog page is based in blog list template but your image refers to blog item.

simogeo commented 7 months ago

yes, actually, I use blog

I always edit manually files ... and doing it through the UI generates a big mess. I don't use blog-item neither particle, I use "blog". Forget my screenshot - sorry.

pmoreno-rodriguez commented 7 months ago

I have tested on a local page based on Gantry and Hydrogen and my blog page works as it should, that is:

I can only think of clearing the cache or clearing the temporary files of your browser, because it seems to work fine.

This is my blog.md:

---
title: 'Blog Page'
blog_url: blog
sitemap:
    changefreq: monthly
    priority: 1.03
content:
    items:
        - '@self.children'
    order:
        by: date
        dir: desc
    limit: 5
    pagination: true
    show_date: true
    leading: 0
    columns: 2
    url_taxonomy_filters: true
feed:
    description: 'Sample Blog Description'
    limit: 10
pagination: true
---
simogeo commented 7 months ago

It should behave as described but it does not.

Can you show me your date format ?

pmoreno-rodriguez commented 7 months ago

It should behave as described but it does not.

Can you show me your date format ?

This is my date config in system.yaml:

dateformat:
    default: null
    short: 'jS M Y'
    long: 'F jS \a\t g:ia'

By default Gantry uses {{ page.date|date(config.system.pages.dateformat.default) }} in partials\blog_item.html.twig`.

There's something I don't understand yet. In Gantry the blog template does not exist, instead blog_list exists. Therefore, I don't understand how you have a blog.md file instead of a blog_list.md.

simogeo commented 7 months ago

I mean, the date format in your item.md files (in blog folder). This is mine :

date: 23-02-2024
publish_date: 23-02-2024

There's something I don't understand yet. In Gantry the blog template does not exist, instead blog_list exists. Therefore, I don't understand how you have a blog.md file instead of a blog_list.md.

I set it manually. But I've also tried to set it through gantry using blog_list / blog_item. Still I got the same error.