1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

All Posts 'Justified' by Default?:

Discussion in 'Styling and Customization Questions' started by CritiKiL, Mar 20, 2013.

  1. CritiKiL

    CritiKiL Active Member

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

    Brogan XenForo Moderator Staff Member

    Add this to EXTRA.css:

    Code:
    .message .messageText {
    text-align: justify;
    }
    
     
    CritiKiL likes this.
  3. QenTox

    QenTox Well-Known Member

    Can this be applied only to a certain forum (category)? Let's say for news (article) type content.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You can try using the node ID in the CSS, e.g. .node22 .message .messageText
     
    Last edited: Jul 30, 2013
    QenTox likes this.
  5. QenTox

    QenTox Well-Known Member

    I will give it a try. Where exactly I find extra.css? :unsure:
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    It's a default template - just search for it in the ACP templates section.
     
  7. QenTox

    QenTox Well-Known Member

    .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?
     
  8. Brogan

    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.
     
  9. QenTox

    QenTox Well-Known Member

    OK, then I leave it as it is now, thanks for your help! :)
     
  10. Brogan

    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>
     
    QenTox likes this.
  11. QenTox

    QenTox Well-Known Member

    This is what I need! EXTRA.css code deleted, this one added to message template and it works just great. Thanks a lot again for your help! (y)
     

Share This Page