Loading...
 
Features / Usability

Features / Usability


[SOLVED] Is it possible to list all sub-categories of a top category using the plugin list

posts: 8633 Israel

Hello,

I'm building a Smarty template where I need a row for each sub-category from a main category.

IE (category years, subcategory 2019-2020) - update every year;
Years
2019-2020
2020-2021
2021-2022
....

I though I could use a plugin list to list each subcategory to create a foreach loop within a td html tag. But I can't find a way to list the subcategories...

Look to me dumb I have to hardcode the category in the template.
May be a trick with another wikiplugin or module ?

posts: 8633 Israel
Jonny Bradley wrote:
Copy to clipboard
{LIST(searchable_only="0")} {filter deepcategories="163"} {filter type=category} {LIST}


Thanks Jonny.
This is a Tiki24.1

I tried your code but still no results.
BTW, I tried with previously with something quite similar (what is this searchable_only="0" ?).

I'm using ElasticSearch as t.o so if it work here it should work also for me.
I compared the Search preferences.

I had "Use unified search in category admin" unchecked, I checked and rebuild index, no change. I did the same for other category or search settings that look related but no luck (rebuilt the index each time). Seems my categories are not indexed {filter type=category} if I remove it I have results (objects).

Must be some settings I don't see (yet)

posts: 126886 United Kingdom
That searchable_only option means you can search for things that are indexed with searchable=n set in them, like categories. Not sure why it's not working for you as it seems to work ok here on tiki.org...
posts: 8633 Israel
Jonny Bradley wrote:
That searchable_only option means you can search for things that are indexed with searchable=n set in them, like categories. Not sure why it's not working for you as it seems to work ok here on tiki.org...


Good to know. Is that documented somewhere ?
(I can do as usual if not, but where ?)

I will try to find what is the missing link for category to be searchable. ;-)

posts: 8633 Israel
Jonny Bradley wrote:

It is mentioned on doc.tiki.org/PluginCustomSearch but could do with some examples and more explanation, maybe on https://doc.tiki.org/UnifiedSearch too?

Ta!


I saw the parameter once but I failed to understand exactly what is does (when I can use it with 0 or 1). Also it is on the customSearch doc page and nowhere in List doc page.

I added information, please review add technical details because I'm really not sure of this part in what I wrote. 🙏


PS: Not really sure how it can be used with https://doc.tiki.org/PluginCustomSearch

posts: 8633 Israel

Arggllll....

While this solution work perfectly on a wiki page or a Smarty template, it doesn't work in the Experiment with plugin LIST tool I was testing in. 🔪

So this is how I ended using it (a column is create for a table with the last 3 categories used)

Copy to clipboard
{wikiplugin _name=list searchable_only="0"} {literal} {pagination max=3} {filter deepcategories="15"} {filter type=category} {sort mode="object_id_ndesc"} {OUTPUT()}<th scope="col">{display name=title}</th>{OUTPUT} {/literal} {/wikiplugin}

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting