Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2014-10-23 16:58:35

etc
Developer
Registered: 2010-11-11
Posts: 5,689
Website GitHub

Re: Article category list with images

You should go first with a direct sql query, with smd_query, obtaining a three “most popular” category list, then extract from this list the first 3 categories with etc_query, that you plug into <txp:categoy_list /> and last use Els snippet.

giampablo wrote #285092:

And can you tell me how to “plug into <txp:category_list />”?

<txp:category_list
	categories='<txp:smd_query query="SELECT Category1 FROM `textpattern` WHERE Category1 > '''' GROUP BY Category1 ORDER BY COUNT(*) DESC LIMIT 3" break=",">{Category1}</txp:smd_query>'
>
...
</txp:category_list>

Offline

#17 2014-10-23 17:27:10

giampablo
Member
From: Italy
Registered: 2008-07-17
Posts: 86
Website

Re: Article category list with images

etc wrote #285093:

You should go first with a direct sql query, with smd_query, obtaining a three “most popular” category list, then extract from this list the first 3 categories with etc_query, that you plug into <txp:categoy_list /> and last use Els snippet.

<txp:category_list...

Great. Now I’m going to download the plug-in and give it a try.

To me queries are an unknown territory. I will study to find a way to extract from Category1 AND Category2.
In any case a category-list from cat1 only is good enough to get the 3 “most popular” categories.

Thanks again, etc

Offline

Board footer

Powered by FluxBB