XF 2.0 Lock thread color

Mian Shahid

Well-known member
Hi,

i have this in XF 1 working well

PHP:
.discussionList .locked .title a {
color: red !important;
text-decoration: line-through;
}

but this is not working in XF 2, any one can tell me correct coding for this?

Regards
 
The locked aspect isn't exposed on that <div> line, you'll need to make an edit:
Template: thread_list_macros

Find:
Code:
<div class="structItem structItem--thread

Add right after:
Code:
{{ $thread.discussion_open ? '' : ' is-locked' }}

Line will look like this:

Code:
<div class="structItem structItem--thread{{ $thread.discussion_open ? '' : ' is-locked' }}{{ $thread.prefix_id ? ' is-prefix' . $thread.prefix_id : '' }}

Then add this to extra.less:
Code:
.structItem.is-locked * { color: red !important; text-decoration: line-through;}

Of course you can edit it however you want using the new class.
 
The locked aspect isn't exposed on that <div> line, you'll need to make an edit:
Template: thread_list_macros

Find:
Code:
<div class="structItem structItem--thread

Add right after:
Code:
{{ $thread.discussion_open ? '' : ' is-locked' }}

Line will look like this:

Code:
<div class="structItem structItem--thread{{ $thread.discussion_open ? '' : ' is-locked' }}{{ $thread.prefix_id ? ' is-prefix' . $thread.prefix_id : '' }}

Then add this to extra.less:
Code:
.structItem.is-locked * { color: red !important; text-decoration: line-through;}

Of course you can edit it however you want using the new class.
Hi mate,

How would I go about capturing the title only? Not the OP's username, thread date, etc.
 
The locked aspect isn't exposed on that <div> line, you'll need to make an edit:
Template: thread_list_macros

Find:
Code:
<div class="structItem structItem--thread

Add right after:
Code:
{{ $thread.discussion_open ? '' : ' is-locked' }}

Line will look like this:

Code:
<div class="structItem structItem--thread{{ $thread.discussion_open ? '' : ' is-locked' }}{{ $thread.prefix_id ? ' is-prefix' . $thread.prefix_id : '' }}

Then add this to extra.less:
Code:
.structItem.is-locked * { color: red !important; text-decoration: line-through;}

Of course you can edit it however you want using the new class.
Sorry for new post in this thread, but any chance in newest XF to change background of closed thread on thread list?
 
Top Bottom