All Posts 'Justified' by Default?:

CritiKiL

Active member
How can I make all posts automatically 'justified' (using the 'align=justify' code), by default?
 

QenTox

Well-known member
You can try using the node ID in the CSS, e.g. .node 22 .message .messageText
.node22 without space did the job, thanks for this, you even guessed the right node number :ROFLMAO:

Now this might be tricky... As it is an article I only need to justify the first (OP) post in the thread. Is is possible to do that or that is too much I ask for?
 

Brogan

XenForo moderator
Staff member
Oops, that was a typo on my behalf - I'll edit the post to avoid confusion.

Unfortunately you can't use a post conditional in the CSS templates.
 

Brogan

XenForo moderator
Staff member
If you were determined to do it though you could edit the message template adding inline styling, like so:
HTML:
<xen:hook name="message_content" params="{xen:array 'message={$message}'}">
<xen:if is="{$post.position} == 0">
<div class="messageContent" style="text-align: justify">       
    <article>
        <blockquote class="messageText ugc baseHtml{xen:if $message.isIgnored, ' ignored'}">
            <xen:include template="ad_message_body" />
            {xen:raw $message.messageHtml}
        </blockquote>
    </article>
   
    {xen:raw $messageContentAfterTemplate}
</div>
<xen:else />
<div class="messageContent">       
    <article>
        <blockquote class="messageText ugc baseHtml{xen:if $message.isIgnored, ' ignored'}">
            <xen:include template="ad_message_body" />
            {xen:raw $message.messageHtml}
        </blockquote>
    </article>
   
    {xen:raw $messageContentAfterTemplate}
</div>
</xen:if>
</xen:hook>
 
Top