Loading...
 
Features / Usability

Features / Usability


Smart list filter (customSearch filter ?) from a category page (category module link)

posts: 8633 Israel

On a Tiki 22 I use a category module in one of my menu to populate it with items from a specific category.

Copy to clipboard
{module module="categories" nobox="y" decoration="0" type="trackerItem" selflink="y" hideEmpty="y" onlyChildren="y" categId="22"}


It has a selflink meaning each menu item is a link to a wiki page with the same name as the category. (cool)

On this page I have a plugin a customSearch plugin to display trackeritems with this category assigned.

Copy to clipboard
{CUSTOMSEARCH(tpl="customSearch.tpl")}{list max="9"} {filter field="tracker_id" content="2"} {filter categories="10"} {output template="product_homeShort_listing.tpl"} {FORMAT(name="category")}{display name="tracker_field_productCategory" format="trackerrender"}{FORMAT} {FORMAT(name="name")}{display name="tracker_field_productName" format="trackerrender"}{FORMAT} {FORMAT(name="brand")}{display name="tracker_field_productBrandName" format="trackerrender"}{FORMAT} {CUSTOMSEARCH}

For each category, each page I have to set manually the category filter
{filter categories="10"}

It means I have a "lot of the same" page with only a change... the filter for the category.

Would it be a smart way to have a single page (alias of all the categories name) getting the category (id) that was clicked for filter ?
To pass into the url the category ID then to have it filtered on landing on the page ?

To be complete it should also be multilingual-proof.
Meaning; categories have a different name depending the language and we should have different destination page for each language. (IE: categorie(10):Kitchen link goes to Kitchen page. categorie(10):Cuisine link goes to Cuisine page)
ha ha ! 😃

posts: 126886 United Kingdom

Hi Bernard

Yes you can biggrin

As described here you can use defaultcat on the url to set a category filter, like:

Copy to clipboard
Search?defaultcat~5=7

where 5 is the parent category (as set in a an input in the form, e.g. {categories _parent="5" _style="select"}) and 7 is the category you want to show.


posts: 8633 Israel

Ok for this part (having the filter set on the customSearch).

But my issue is just before that.
From the category module that generate the menu I have a link with the category name (not the id).
Screen Shot 2021 02 07 At 14.35.34

And so I have one for each item.
My idea is to have all link landing on the search page with the "Search?defaultcat~5=7" url parameter set accordingly.

Thanks for your time Jonny.


posts: 8633 Israel

There is everything in Tiki... 😉

I missed the custom URL parameter in the module category.
My understanding is that it allow to create a custom URL with the catId, something like:

Copy to clipboard
{module module="categories" nobox="y" decoration="0" type="trackerItem" selflink="n" customURL="Search?defaultcat~22=%catId%" onlyChildren="y" hideEmpty="y" categId="22"}

But...
%catId%
is not working as expected and the url look like this:
Search?categ=%CAtid%
😞

I’m stuck here...


Sidenote: If I try with
%name%
the link is correct:
Search?categ=cooktops
And if I don’t specify a custom URL I have
cat10-Cooktops


So I tried to use those results with customSearch filters on tracker_field but I couldn’t get it to work re 😞



posts: 8633 Israel

Thank to your comment in a different discussion I explored the plugin List way.

Copy to clipboard
{LIST(searchable_only="0")} {list max="100"} {filter deepcategories="1"} {filter type=category} {OUTPUT()} [ProductBrowse?defaultcat~1={display name="object_id"}|{display name="title"}] {OUTPUT} {LIST}


However I hit a wall.
My categories are built as follow:

Products
->Kitchen
->->Ovens
->->Fridges
->Salon
->->Tv Screens
->House
->->Washing machine

I want to display the last child only (Ovens, Fridges, Tv Screens, Washing machine) and not (Kitchen, Salon, House)
I don’t see a child child option...


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