getgrav / grav-plugin-archives

Grav Archives Plugin
https://getgrav.org
MIT License
8 stars 12 forks source link

Fix collection retrieval #28

Open nbusseneau opened 4 years ago

nbusseneau commented 4 years ago

children() only retrieves direct children, as per the code: https://github.com/getgrav/grav/blob/1.6.27/system/src/Grav/Common/Page/Page.php#L2422

collection() is the proper retrieval method: https://github.com/getgrav/grav/blob/1.6.27/system/src/Grav/Common/Page/Page.php#L2675

This can be confirmed by looking at what's used in default Quark theme when retrieving collection blog page template: https://github.com/getgrav/grav-theme-quark/blob/2.0.3/templates/blog.html.twig#L3

nbusseneau commented 4 years ago

I noticed this while trying to use the archive plugin with an @self.descendants collection :)

mahagr commented 3 years ago

@rhukster Can you take a look?

nbusseneau commented 3 years ago

Bumping this -- don't hesitate to HMU if I can do anything.

nbusseneau commented 2 years ago

@rhukster Revisiting old PRs -- is there anything I can do to get this across the finish line?

rhukster commented 2 years ago

I have this issue in a list to review when i get a chance. Need to test to ensure backwards compatibility as it is changing a behavior that users might rely on.