L3010
New Member
Posts: 49
inherit
264353
0
Mar 4, 2023 7:57:32 GMT -8
L3010
49
May 2021
l3010
|
Post by L3010 on Aug 27, 2021 1:21:52 GMT -8
Hi! I want to have the Mini-Profile look differently for each category.
Fetching the category ID in the "board"-layout template can be done with $[board.category_id] At "thread" it can be done with $[thread.category_id]
But there doesn't seem to be a variable similar to $[board] and $[thread] in the Mini-Profile layout template.
does anyone know how to do something similar in the "mini-profile"-layout template?
* * *
More about what i want to do and another way that i could go about solving the problem
What i want to do is to change the Mini-Profile background color (CSS: div.mini-profile) – to a different color depending on the category.
If there is no way to fetch the Category-ID in the "mini-profile"-layout template i could add CSS (in a <style> tag) in the "thread"-layout template inside a {if}-tag, the {if}-tag would be checking for the Category-ID.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Aug 27, 2021 8:14:51 GMT -8
You can't do that in the mini profile template; those variables aren't available there.
However you could do it in the post template, adding category conditional classes around the mini profile placeholder. Do you need assistance doing that, or is this enough to get you started?
|
|
L3010
New Member
Posts: 49
inherit
264353
0
Mar 4, 2023 7:57:32 GMT -8
L3010
49
May 2021
l3010
|
Post by L3010 on Sept 1, 2021 6:35:17 GMT -8
I can do it
<style type="text/css"> div.mini-profile { {if $[thread.category_id] == 4} background-color: var(--bg-4-border) !important; {/if} {if $[thread.category_id] == 5} background-color: var(--bg-5-border) !important; {/if}
} </style>
|
|
L3010
New Member
Posts: 49
inherit
264353
0
Mar 4, 2023 7:57:32 GMT -8
L3010
49
May 2021
l3010
|
Post by L3010 on Sept 1, 2021 7:16:57 GMT -8
<style type="text/css" id="miniProfileColors"></style> <script type="text/javascript"> var miniProfileColors = document.getElementById('miniProfileColors'); var catId = $[thread.category_id]; miniProfileColors.innerHTML = `div.mini-profile { background-color: var(--bg-${catId}-border) !important; }`; </script>
|
|