getCategories() and Site Menu

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 6, 2015   (RSS)

By Perchpole - April 6, 2015

Hello, All

I'm just about to complete a new CMSB website for a client which has taken quite a while to put together. As part of a tidying-up process I'd like to do some optimisation. In particular I am concerned about the size of the main "categories" table. It holds a ton of data - everything from meta tags to permalinks to what to show in the margins. As only one category "page" is ever shown at any one time this isn't normally a problem. However, what's more of a concern is the site navigation system. It uses the same getCategories() call but instead of one page it draws info from every category on the site.

To my way of thinking this one call must be the biggest drain on the server - but for very little return. Each item on the menu represents one category page but all I need from it is the name, num and globalOrder. All the other info mentioned above is completely unnecessary.

So, I've hit upon the idea of building the menu system with a query. It seems simple enough but am I making a fundamental error?

Also, by using a query I am unable to access pseudo elements such as _hasChild which is going to make child menu items harder to produce.

Thoughts please...

:0/

Perch