PDA

View Full Version : Template Conditional for threads by a specific author


malmazan
05-05-2017, 08:09 PM
Hi all

I need to change the appearance of threads started by a specific author.

What would be the template conditional for that?

Ideally by user id number, else by author name. Since the author is also the admin, a conditional for admin thread authors could also be a compromise solution. Using a plugin is fine.

Thanks in advance for the help

Dave
05-05-2017, 08:24 PM
Threads use the SHOWTHREAD template. Just before </head> you could add the following condition:

<vb:if condition="$thread['postuserid'] == 1">
{vb:cssfile davethreadstyle.css}
</vb:if>

Then create a new template called davethreadstyle.css (or whatever you named it in the code above) and it will load it in a thread when the thread is started by userid 1. Add your custom CSS to the CSS template.

Alternatively, instead of injecting a CSS file, you could use the regular CSS style tag like this:
<vb:if condition="$thread['postuserid'] == 1">
<style type="text/css">
.element{
attribute: value;
}
</style>
</vb:if>

CAG CheechDogg
05-06-2017, 03:25 AM
So how exactly does this look ?

malmazan
05-06-2017, 10:48 AM
That works, many thanks Dave