Forums › Forums › Search & Filter Pro › Category description
- This topic has 4 replies, 2 voices, and was last updated 4 years, 8 months ago by
Trevor.
-
Anonymous(Private) November 3, 2020 at 10:16 am #265015
Hi
I am trying to get the category description from the active category.
I found this topic: https://support.searchandfilter.com/forums/topic/category-description/, but I does not seem to work for me or I don’t completely understand what the solution is.
Is there any way to do this?
Thanks!
Anonymous(Private) November 3, 2020 at 12:47 pm #265049Right now I am not using any code since I don’t really understand the other topic.
The thing I want to achieve is to get the descriptions from all categories. I am trying to add a short description for every filter on my page through a tooltip, so I need to get all the category descriptions with for example a data attribute with the category name.
Anonymous(Private) November 3, 2020 at 2:41 pm #265096My last message wasn’t very clear so here is a better explaination. It would be useful for us to ‘change’ the filter section, For example if we can add the category description directly within the filter form.
<li class="sf-level-1 sf-item-28" data-sf-count="0" data-sf-depth="1"> <input class="sf-input-checkbox" type="checkbox" value="meubilair" name="_sft_product_cat[]" id="sf-input-e1580d486231b2d2cc5c9c1e1477f2d9"> <label class="sf-label-checkbox" for="sf-input-e1580d486231b2d2cc5c9c1e1477f2d9">Meubilair</label> <div>CATEGORY DESCRIPTION HERE</div> </li>
So as shown above I want to get the description in an extra div for every category or taxonomy.
Is this possible?
Trevor(Private) November 3, 2020 at 4:40 pm #265164If it were possible, I do not know how you would do this, and I suspect it would break our filter, as the filter relies on the form HTML structure to work, and adding a div like that could break it.
Fetching the description would need PHP, but adding it in to the form would need JavaScript, and I cannot see that working, sorry.
-
AuthorPosts