Hello, I was wondering if there is any way to add color to the “(% class=“box” %)” . Been trying to figure it out but i am honestly stumped.
Not sure what you mean but you can always use (% style="..." %)
and put any CSS in there.
For example, say I have this group of code:
(% class="box" %)
(((
{{blogpostlist blog="Blog.WebHome" category="Blog.CEO's Blog" fromDate="2017-06-01" params="displayTitle=true|useSummary=true" layout="image" limit="1"/}}
)))
This places the blog post within the standard grey box, I dont understand the syntax well enough to place the “(% style=”…" %)" correctly, as all my attempts seem to simply leave the box in its default state.
I think you should use the {{box}}
macro since it’s meant for this. Check that macro’s param tehre’s a cssClass param if I remember well.
I did that initially, but as you can see I have another macro running within box (the blog post macro), and if I am not mistaken, it will not run within the {{box}} macro, hence why I went for (% class=“box” %).
It should work just fine. You can put macros inside the box macros. Any rendering syntax will work.
For example I just tested on playground with:
{{box}}
Hello {{useravatar username = "xwiki:XWiki.VincentMassol"/}}
{{/box}}
You can try something like
{{box cssClass="infomessage"}} {{blogpostlist ... /}} {{/box}}
where cssClass can have values: infomessage, warningmessage, errormessage, successmessage
for blue, yellow, red and green colors.
If you want a different range, you need to use CSS styling.