Recent searches
No recent searches
Home Page Category Display - How to Write If/Then/Else
Posted May 24, 2024
Hi guys, I'm having a basic conundrum..I'd like to pick out one of my categories using an if/then in my home page code, and style that category box differently than the rest. What is the procedure for writing if/thens and referencing a category?
Thanks in advance!
0
3
3 comments
Peter Piek
Tim Gilbreath You can try something like this:
<div id="main-content"
{{#is category.id 360000123456}} class="my-first-class"
{{else}}
{{#is category.id 360000888444}} class="my-second-class"
{{else}}
{{!-- do more stuff here --}}
{{/is}}
{{/is}}
>
0
Tim Gilbreath
Hmm for some reason that's giving me an error saying it either can't use #is in that manner, or that ID is not available in category.
This is the block of code I'm trying to run it on, basically I want one category to have a different style:
I discovered that
<li class="blocks-item" id="{{id}}">
is the item that I need to style, which I've already created in the style sheet.0
Peter Piek
Tim Gilbreath I used this in 'templates/category_page.hbs'
0