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

XF 1.5 Using CSS, how to trim Thread Title after a certain length with "..."

Discussion in 'Styling and Customization Questions' started by Neutral Singh, Mar 13, 2016.

  1. Neutral Singh

    Neutral Singh Well-Known Member

    Say after like 35 characters, the title display is replaced by ... at the end of the title. How?

    I guess, this css needs some modifications...

    HTML:
    .discussionListItem .title {
      font-size: 10.5pt;
      word-wrap: break-word;
    }
    
    i tried putting this in above CSS but it did not work....

    HTML:
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    overflow: hidden;
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The ellipsis will be applied for the overflow condition.

    If you want to trim the title to 35 characters and automatically apply ellipsis, you can use the wordtrim helper, like so:
    HTML:
    {xen:helper wordtrim, $thread.title, 35}
     
    Steve F and Neutral Singh like this.

Share This Page