XF 2.2 How to change background color prefix description?

-Eric-

Member
Hi,

is a prefix for thread (phrase: thread_prefix_desc.1)
1716684789278.webp
In the Browser Inspector:
CSS:
.blockMessage.blockMessage--alt {
    color: #141414;
    background: #f5f5f5;
}

I saw the thread about style (extra.less) with:
CSS:
.blockMessage--close.prefixDesc--id2 {
    border-left: 3px solid #d31117;
}
I tried but I couldn't
 
I changed this in the browser:
Generally what you do there in the browser will be exactly what you can put in extra.less so the above screenshot code should work in extra.less template.

And if it doesn't work:

1) make sure you are editing the template of the relevant style.

2) In some cases note that you may find you may need to give something priority by adding !important, e.g. in this case

Code:
.blockMessage.blockMessage--alt
{color:#ffffff;
background:red!important;}
 
If I use what you described, it will affect all prefixes that have a description.
It doesn't affect the prefix, it only affects prefix descriptions though.

Or do you mean you want it to affect the description depending on what prefix the thread has? I don't think you can do that, prefix description collar will apply to all descriptions. I think you would need some custom development to do that.

(I might be wrong of course which would be great)
 
like I said, I need to change the color of specific prefix.
If I use your example, it will affect the color in all prefixes that have a description.

An alternative, I can use HTML within the description, but it will color the text region.
1719752880399.webp
1719752955202.webp
 
It's not very clear what you are trying to do...
Do you want to change the background color of a prefix or the background color of the description depending on the selected prefix?
 
It's not very clear what you are trying to do...
Do you want to change the background color of a prefix or the background color of the description depending on the selected prefix?
Yes, as exemplified in the images and also in the prefix edition.
Just the description of a specific prefix. The closest thing to this was what I posted previously.
 
You will need to edit the thread_view template with conditional statement, this part:
HTML:
<xf:if is="$thread.prefix_id">
    <xf:if contentcheck="true">
        <div class="blockMessage blockMessage--alt blockMessage--small blockMessage--close">
            <xf:contentcheck>{{ prefix_description('thread', $thread.prefix_id) }}</xf:contentcheck>
        </div>
    </xf:if>
</xf:if>
 
Back
Top Bottom