Date Navigation Block with Page Counter
Permalink
I've been trying to figure out a way to display the number of pages that my website's blog has within the date navigation block. The view.php page is very simple. So simple, in fact, that I cannot seem to find a relationship between the date controller and nav controller.
Basically, I would like the output to look like this:
September 2015 (6)
October 2015 (13)
November 2015 (8)
Any ideas? I have googled this like crazy and found nothing even close.
Basically, I would like the output to look like this:
September 2015 (6)
October 2015 (13)
November 2015 (8)
Any ideas? I have googled this like crazy and found nothing even close.
You are awesome. I made a template for the block in the application folder with the changes that you made and it worked FLAWLESSLY! Thank you SO much. I would have spent forever trying to figure this one out!
Glad it helped :)
Hello,
I'm looking a way to filtered only by years and have something like this :
2020 (8)
2019 (12)
2018 (6)
If it's possible to modify the navigation date block or in other case use a add-ons.
Thanks.
I'm looking a way to filtered only by years and have something like this :
2020 (8)
2019 (12)
2018 (6)
If it's possible to modify the navigation date block or in other case use a add-ons.
Thanks.
First, I'm not an expert on this block, so maybe someone has a better solution.
All the logic is in the controller.php file, that's where the Date Navigation block gets and filters the page list.
So I think you should override the controller block or create a new block based on the core Date Navigation block.
Then in the controller you should change this line:
to:
This should get the number of pages.
Also in the controller change this line:
to:
This should make the counter variable available in the view.php file, so you could print it like this (within the $dates loop):
Hope this helps!
Jordi