This is possible if you use CMS with some custom code. Here is how I achieved it.
Create a global class for the style you want.
Create a CMS field and add that class name inside it. You can also create a separate CMS for all the classes in the project as well if you want more than one class. Using multiple classes will require a multi-reference field.
Add an embed field in your page and in the class attribute you can add the class CMS field you made.
You can then apply a condition using a switch or by the status of any field and based on that status you can add or remove the class you want.
Example:
bg-black:{ background-color: black; }
CMS Field name: Bg Color CMS Field value: bg-black
<div class="Bg Color">Lorem Ipsum</div>
NOTE: This will work for a CMS collection page, not for a static page. For static page you might be able to something similar inside a collection list but I have not implemented it yet.
This is possible if you use CMS with some custom code. Here is how you I achieved it.
Create a global class for the style you want.
Create a CMS field and add that class name inside it. You can also create a separate CMS for all the classes in the project as well if you want more than one class. Using multiple classes will require a multi-reference field.
Add an embed field in your page and in the class attribute you can add the class CMS field you made.
You can then apply a condition using a switch or by the status of any field and based on that status you can add or remove the class you want.
Example: bg-black:{ background-color: black; }
CMS Field name: Bg Color CMS Field value: bg-black
<div class="Bg Color">Lorem Ipsum</div>
NOTE: This will work for a CMS collection page, not for a static page. For static page you might be able to something similar inside a collection list but I have not implemented it yet.
This would be great for styling different objects by their category. It would also be great for the mix-it-up plugin - as well as many other plugins i'm sure
Crazy this hasn't been implemented yet
I've been trying every which way from friday to add a different font to headers + body based on which CMS item is featured.
I've tried a script that would add a class (many ways)
I've tried Shahroze Mirza's suggestion (so smart).
One of these should work, right?? I don't understand what I'm doing wrong. Is there anyone who'd be able to take a look with me?
It's a project for a foundation, I'm doing this because I believe in the cause, but I"m getting ready to pull my hear out... :(
This is possible if you use CMS with some custom code. Here is how I achieved it.
Create a global class for the style you want.
Create a CMS field and add that class name inside it. You can also create a separate CMS for all the classes in the project as well if you want more than one class. Using multiple classes will require a multi-reference field.
Add an embed field in your page and in the class attribute you can add the class CMS field you made.
You can then apply a condition using a switch or by the status of any field and based on that status you can add or remove the class you want.
Example:
bg-black:{ background-color: black; }
CMS Field name: Bg Color
CMS Field value: bg-black
<div class="Bg Color">Lorem Ipsum</div>
NOTE: This will work for a CMS collection page, not for a static page. For static page you might be able to something similar inside a collection list but I have not implemented it yet.
This is possible if you use CMS with some custom code. Here is how you I achieved it.
Create a global class for the style you want.
Create a CMS field and add that class name inside it. You can also create a separate CMS for all the classes in the project as well if you want more than one class. Using multiple classes will require a multi-reference field.
Add an embed field in your page and in the class attribute you can add the class CMS field you made.
You can then apply a condition using a switch or by the status of any field and based on that status you can add or remove the class you want.
Example:
bg-black:{
background-color: black;
}
CMS Field name: Bg Color
CMS Field value: bg-black
<div class="Bg Color">Lorem Ipsum</div>
NOTE: This will work for a CMS collection page, not for a static page. For static page you might be able to something similar inside a collection list but I have not implemented it yet.
Really could use this to style different classes of items differently. Surprised Finsweet or someone else hasn't come up with a workaround.
Still missing, why?
This seems so obviously integral, am I missing something?
Upvote
Yes, it is very important
Yes please!
Yes. For example, a CMS-powered list of features, and ones with the "Important" label get a different color background and a drop shadow.
We need this very badly to use to show/hide content on multi-language sites.
This would be great for styling different objects by their category. It would also be great for the mix-it-up plugin - as well as many other plugins i'm sure