Number of articles in subcategories Topic is solved
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat Nov 01, 2014 6:42 pm
Number of articles in subcategories
Hello!
I have a category with numerous subcategories.
Is there a way for me to display the combined number of articles in all subcategories?
It is quite important to be able to show the increase in number of articles through time, and it would be great not to have to do it manually.
Thank you!
I have a category with numerous subcategories.
Is there a way for me to display the combined number of articles in all subcategories?
It is quite important to be able to show the increase in number of articles through time, and it would be great not to have to do it manually.
Thank you!
- sozzled
- Joomla! Master
- Posts: 13326
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: Number of articles in subcategories
Yes (but not out of the box).

Where (or how) would you like to do this?

“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au

-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat Nov 01, 2014 6:42 pm
Re: Number of articles in subcategories
Of course

I made a website for a local community, and it's main use is putting certain locations on a map.
Map is populated by using joomla articles that are divided in one level of subcategories inside a root category, every article is also a place on the map, and I'm using Yootheme page builder to do that dynamically - every time I add a new article it automatically shows on the map.
I would like to be able to say this on the frontpage:
Currently, there is X locations on the map. (X is the number of articles in all subcategories).
- sozzled
- Joomla! Master
- Posts: 13326
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: Number of articles in subcategories
You asked if it is "possible" to display the number of articles, in all categories. Yes, this is possible but this facility is not available out-of-the-box without making a custom feature.
I asked you where do you want to display this information. Do you want to display this information on the frontend or backend of your website? Do you want this information displayed at the top, bottom, side or in the middle of a page on your website?
How would you like this to appear? Would you like something like "There are 25 articles here"
Please explain what you would like. Anything is possible (but everything has a cost); the cost is your time (or money) or someone else's time to create what you would like. I can't give you more information if we don't know what you would like.
Back to you.
I asked you where do you want to display this information. Do you want to display this information on the frontend or backend of your website? Do you want this information displayed at the top, bottom, side or in the middle of a page on your website?
How would you like this to appear? Would you like something like "There are 25 articles here"

Please explain what you would like. Anything is possible (but everything has a cost); the cost is your time (or money) or someone else's time to create what you would like. I can't give you more information if we don't know what you would like.
Back to you.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au

-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat Nov 01, 2014 6:42 pm
Re: Number of articles in subcategories
I thought I explained it well, but here it is again:
I would like to be able to say this on the frontpage:
Currently, there is X locations on the map. (X is the number of articles in all subcategories).
The frontpage usually means the frontend of the website.
For the sake of this conversation, let's say I want it shown on the bottom of the page.
Thank you for your help.
I would like to be able to say this on the frontpage:
Currently, there is X locations on the map. (X is the number of articles in all subcategories).
The frontpage usually means the frontend of the website.
For the sake of this conversation, let's say I want it shown on the bottom of the page.
Thank you for your help.
- sozzled
- Joomla! Master
- Posts: 13326
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: Number of articles in subcategories
In that case (if this were my website), I would create a module, install it on the site, and assign it to a template position on the bottom of the page. As I wrote before, such a feature doesn't exist (as far as I'm aware). As I also wrote, it's possible to develop such a module but, as I also wrote, it will cost ... your time or your money.
If you want this feature—if it's important to you—you have to figure out the best way for you to develop a module. If you cannot write a module yourself, there are professional website developers who can do this for you. Only you can answer these questions.
Sure, I could build a module like this (if I wanted to) but I don't have any incentive or need for it.
If you want this feature—if it's important to you—you have to figure out the best way for you to develop a module. If you cannot write a module yourself, there are professional website developers who can do this for you. Only you can answer these questions.
Sure, I could build a module like this (if I wanted to) but I don't have any incentive or need for it.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au

-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat Nov 01, 2014 6:42 pm
Re: Number of articles in subcategories
Well, Mr. Sozzled, thank you so much for your time!
I'm glad to now know that you're more than capable of building a module like that, but at the same time I'm so sad that I don't have the time to go through the other 13230 of your posts to see what other great advice you gave to the visitors of this forum.
Maybe one day...
I'm glad to now know that you're more than capable of building a module like that, but at the same time I'm so sad that I don't have the time to go through the other 13230 of your posts to see what other great advice you gave to the visitors of this forum.
Maybe one day...

- sozzled
- Joomla! Master
- Posts: 13326
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: Number of articles in subcategories
As I say, if this is important to you and you want a module to display "Currently, there are x locations on the map" at the bottom of your J! 3.x website, you can always post a request on the Professional Development Services forum here together with an offer of payment.
If this requirement is not important to you, please mark this topic as "resolved" and good luck with your website.
If this requirement is not important to you, please mark this topic as "resolved" and good luck with your website.

“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au

-
- Joomla! Apprentice
- Posts: 6
- Joined: Sat Nov 01, 2014 6:42 pm
Re: Number of articles in subcategories
Agreed, but let's offer a short resume for future generations before we do that:
Joomla doesn't offer an option to show the number of articles in subcategories of a root category.
Joomla doesn't offer an option to show the number of articles in subcategories of a root category.
- sozzled
- Joomla! Master
- Posts: 13326
- Joined: Sun Jul 05, 2009 3:30 am
- Location: Canberra, Australia
Re: Number of articles in subcategories
I would rephrase your statement like this:
There is no facility in J! 3.x to display the total number of articles, from all categories, as a single line that reads "Currently, there are x locations on the map", appearing anywhere on the frontend of the website.
Obviously, you can find out how many articles you have on a J! website using SQL. For example:
1) To calculate the total number of articles—including published, unpublished, trashed and archived articles—the SQL query would be:
Code: Select all
SELECT COUNT(id) FROM xxxxx_content;
2) To calculate the number of articles that are published on your site, the SQL query would be
Code: Select all
SELECT COUNT(id) FROM xxxxx_content WHERE state = "1";
Code: Select all
SELECT COUNT(id) FROM xxxxx_content WHERE (state = "1" OR state = "2");
The general idea is that you can't do this out of the box without writing PHP.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
Walking the talk: https://j4xdemo.enduring.com.au
