XF 2.2 How to display full attachment names?

sbj

Well-known member
I used to do this and it displayed fully the name:

CSS:
.attachment-name {
    white-space: unset;
    word-wrap: unset;
}

Now it doesn't work anymore, how to update this? I couldn't find the right css selector to do this for XF 2.2.

This is very important to me. I use a versioning system in attachment names and I need to be able to see attachment names fully.

1612826891797.png
 
Last edited:
use file-* classes instead and modify also overflow fom file-meta-.

But it might not be very easy.

Yeah, I found the new classes but I could not make it to work.

I tried this:

CSS:
.file-name {
    white-space: unset;
    word-wrap: unset;
}

.file-info {
    height: 20px !important;
}

but I can't get the black bar collapsing and display the full name of an attachment. I wouldn't think it would be this hard to just simply display attachment names. Did nobody complain before about this or what? :D
 
@Hoffi
Well ugly, but at least one step closer. If you have 2 attachments, the one name goes behind back the 2nd one and overall this way is really not that useful :D.

If you add white-space-unset, it actually doesn't overflow to the right side anymore and stays within the width of the icon.

CSS:
.file-info {
    overflow: visible;
    .file-name, .file-meta {
        overflow: visible;
        white-space: unset;
    }
}

See:

1613314709083.webp

So, the "only" problem left to do is how to enhance the height of the blackbar to match the text automatically, so it collapses to the bottom.
 
@Hoffi
Well ugly, but at least one step closer. If you have 2 attachments, the one name goes behind back the 2nd one and overall this way is really not that useful :D.

If you add white-space-unset, it actually doesn't overflow to the right side anymore and stays within the width of the icon.

CSS:
.file-info {
    overflow: visible;
    .file-name, .file-meta {
        overflow: visible;
        white-space: unset;
    }
}

See:

View attachment 246344

So, the "only" problem left to do is how to enhance the height of the blackbar to match the text automatically, so it collapses to the bottom.
can you not just adjust the height of .file-info..?
it has a hover function on it as well so theres a sort of hidden height but seems like there could still be room, not sure what else you could do really
 
  • Like
Reactions: sbj
can you not just adjust the height of .file-info..?
it has a hover function on it as well so theres a sort of hidden height but seems like there could still be room, not sure what else you could do really
I tried, but it doesn't work. I increased height to 50px, but it does not collapse.
 
heres my final code im trying....needed to adjust a few other things but i like the idea of this, glad you pointed it out

Code:
.file-info {
    overflow: visible;
white-space:normal;
height: 4.5em;
line-height: 1.5;
padding: 0 4px;
}
.file-info:hover {
height:auto;
}
    .file-name, .file-meta {
        overflow: visible;
        white-space: unset;
    }
 
Last edited:
  • Like
Reactions: sbj
hmm yeah thats one long file name.....i suppose you can adjust the height more but at some point you have to choose if you want to cover the entire image or how much of it...we most commonly get these slightly longer file names....you can try shinking the font and such as well of course.

im wondering if there isnt a code that can flex the height and have a limit set, but thats beyond me for now.
regards
 
I have close to 80k attachments attached to posts. And most of them are very long names due to a versioning system I use.

This is how my 2.1 looks like and it adjusts automatically to each name with that simple 2 line of css mentioned in 1st post:

1613325319359.png
 
oh btw, sbj you got some extra code on there somewhere as mine doesnt overflow like your pic, just cuts title off when it reaches height if title is too long...then now with hover shows the full title...
 
Top Bottom