template.js conditionals doesn't work
-
Hi,
How can I use the conditionals if I want to compare the value.
For example:<!-- IF (categories.parentCid == selectedCategory.cid) -->
It does't work now.
Thanks
-
@audreybest you can't. You'll have to use a helper or do that logic elsewhere. Maybe there's a
category.isSelected
boolean that already reflects if the category is the selected one? -
@PitaJ Thanks for your reply. I wanted the case, if the subcategory is selected then parent category also selected.
But now if the subcategories selected, then parent categories.isSelected = false.
Maybe I should do a plugin?
Copyright © 2024 NodeBB | Contributors