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

XF 1.1 Limit signature size ?

Discussion in 'XenForo Questions and Support' started by account8226, Dec 11, 2011.

  1. account8226

    account8226 Guest

    Any way to limit the number of lines on a signature on my forum ?

    Best regards !
     
    Blue likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Try adding something like this to EXTRA.css:

    Code:
    .message .signature {
    max-height: 100px;
    overflow-y: auto !important;
    }
    Change the values to suit.
     
    ForestForTrees and Elly like this.
  3. account8226

    account8226 Guest

    It worked thanks you very much Brogan ! :) :) :)
     
  4. chrishill

    chrishill Active Member

    This works well for me too :)
    I just have one question. Is there a way to cut it off and make the signature not scrollable? Then it wouldn't have to load tons of text and links, this would be an easy antispam if you know how to do this.
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Try using overflow: hidden.
     
    chrishill likes this.
  6. chrishill

    chrishill Active Member

    So is this correct?
    Code:
    .message .signature {
    max-height: 85px;
    overflow: hidden
    }
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Plus a semicolon:

    Code:
    .message .signature {
    max-height: 85px;
    overflow: hidden;
    }
    
     
    ForestForTrees likes this.
  8. dieketzer

    dieketzer Well-Known Member

    to expand a bit...
    the above code will only apply to the sig visible in the message. it wont alter the sig in their profile, nor will it affect the signature creation preview.

    for sig in message and also sig in profile:
    Code:
    /* limited sigs */
    .signature
    {
    max-height: 105px;                    /* adjust as needed */
    opacity: 0.6;                         /* means 60% opacity. 0.6 is partially transparent - 1.0 is no transparency at all */
    padding: 0px;
    overflow:hidden;
    overflow-y: hidden !important;  /* old ie fix */
    overflow-x: hidden !important;  /* old ie fix */
    }
    to also affect the signature preview you need to make a template edit.
    in template account_signature_preview:

    change this line
    Code:
    <div class="messageText primaryContent baseHtml">{xen:raw $signatureParsed}</div>
    like so:
    Code:
    <div class="messageText primaryContent baseHtml signature">{xen:raw $signatureParsed}</div>
     
    ForestForTrees and chrishill like this.
  9. chrishill

    chrishill Active Member

    What is opacity for? I mean the signatures them selves are solid images...
     
  10. dieketzer

    dieketzer Well-Known Member

    setting opacity to anything less than 1.0 will cause the entire sig, images included, to become partially transparent.
     
  11. chrishill

    chrishill Active Member

    This mod should be more popular. It's essential to have them limited to at least 200px, or it spams your forum.
     
  12. chrishill

    chrishill Active Member

    Hmm, this was marked as 1.1, does that mean it will not work now - or is there a better way to do this now?
     
  13. Nasr

    Nasr Well-Known Member

    Current version is 1.1.3, so it should work.
     
  14. chrishill

    chrishill Active Member

    I edited this here:
    <edited this out, took a lot of space>
    So how can I get this to preview in the signature preview too?

    And did I copy that right? I copied the "{"s the first time but it messed up the format of the whole page...
     
  15. Nasr

    Nasr Well-Known Member

    You need to do template edits and not through the style properties.
     
  16. chrishill

    chrishill Active Member

    Yeah that's what I was going to try next. I don't think I can hook this in to the preview if I only use style properties.
     
  17. MagnusB

    MagnusB Well-Known Member

    I think it should work through style properties, as long as it pertains to the correct CSS rule. It could be easier to just do it through EXTRA.CSS

    Code:
    .signature {
      max-height: 150px;
      opacity: 0.6;
      overflow: hidden;
    }
    As for the preview, I checked it. There is no sane way to do it through CSS rules, you need to do an template edit. Open account_signature_preview, find
    HTML:
    <div class="messageText primaryContent baseHtml">{xen:raw $signatureParsed}</div>
    Change to:
    HTML:
    <div class="messageText primaryContent baseHtml" style="max-height: 150px; opacity: 0.6; overflow; hidden;">{xen:raw $signatureParsed}</div>
    EDIT: Corrected one small error

    EDIT 2: Indeed I did forget overflow: hidden, edited it in
     
  18. chrishill

    chrishill Active Member

    Yeah I think this will work too. It's strange that I get slightly different results from the preview than on the forum... like text is smaller on the forum thread lol.
     
  19. chrishill

    chrishill Active Member

    Wait... I think we forgot "overflow: hidden"...
    And I don't see a difference in opacity hmm.
     
  20. MagnusB

    MagnusB Well-Known Member

    As you see, the preview is defined with different classes. If you have changed the font size in the signature, you might want to take that into account. If you have a test account and are comfortable with PMing me the details, I can take a look at it for you.
     

Share This Page