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:
Auto seems to help more, but it still is really ugly and not functioning.

And I need the full display of the name, not cutting anything off as the last 2 letters display the version of attachment such as "v1 or v5".
Displaying full name on hover is not useful at all, actually very annoying and distracting as the name jumps in and out.

See current version. The damn black bar should collapse down and not inside the icon. If the name is long, it just covers the whole attachment icon.

att.gif
 
perhaps something in the direction of a negative bottom margin will step in the direction you need....by quick check i could see i was able to bump it down at least but theres another code you need because well, for me at least it cuts off, but by your pics you may already fixed that looks like...
 
This might work:

Code:
.attachmentList .file:hover
{
    .file-info
    {
        height: auto;
    }
    .file-name, .file-meta
    {
        overflow: visible;
        white-space: normal;
        text-overflow: clip;
    }
}

Shows full file name on hover. If you remove the :hover CSS it'll make it so it always shows the full info. You lose the animation on this because of the height being set to auto.
 
@Russ

Thanks, this one is the closest so far, as it finally displays the names fully. But...

1613348994780.webp

Well, the black background thingy covers the whole icon now. And the filename can't be read well, too. Then if you edit the post, it still goes back to the problem while one can't see what was attached.

1613349095370.webp

Compare it to XF 2.1

1613349254592.webp


In 2.1 one can easily read filename and file ending in both post and post editing.
 
I'd suggest working on some better file names :)

You're probably better off editing the attachment template (attachment_macros) and changing the location of the filename. It's easy to break just about any element in XF using filler text, if your filenames will be there long I'd suggest changing them out of the overlay.

Side note, "attachmentList" isn't in on the editing page as far as I can tell. Did you change my CSS to something else to cause that to happen?

Maybe approach it with my edit I did here: https://xenforo.com/community/threads/attachments-like-vbulletin.164618/#post-1406332
 
  • Like
Reactions: sbj
I'd suggest working on some better file names
Just so you understand the value of long file names. My content is based on attachments and I have a very good system going on. All my users appreciate having exact filenames, because they use them daily in their professional careers. (I am talking about music sheet and musicians). So, they have to know which file is which piece and which version it is.

One song can have more than 15 different versions written in 200 years span. That means 15 files. So, one look at the filename and you see the name of the song, who wrote the song and what version it is. We talk daily about the different versions like "v1 has note xyz, but v6 doesn't, why?" by using the version numbers, which are at the end of filenames. Without this it makes my content half-useless because we can't talk about them. We need to know about which version of a song we are talking about. Not to mention, when musicians download those files, they now know what they downloaded because the filenames tell them. So 2 years later one look and they still know what was downloaded. I host 70k attachments now, that makes 45k songs. So, you might understand how important it is when you just have tens of songs downloaded and the filenames make it easy to tell them apart.

This might look like a niche problem, but to be honest, it should be a given that a software should provide a way to see attachment names. I think it is a pretty trivial thing to ask from a software and I can't understand why they changed this behaviour in 2.2 so much, that it is a big problem.

You're probably better off editing the attachment template (attachment_macros) and changing the location of the filename. It's easy to break just about any element in XF using filler text, if your filenames will be there long I'd suggest changing them out of the overlay.
That is actually what I want to do, to break them out of the overlay but I don't know how to do. I tried with css to collapse the overlay to the bottom but it keeps being on the icons all the time.

Side note, "attachmentList" isn't in on the editing page as far as I can tell. Did you change my CSS to something else to cause that to happen?
Exactly, it isn't, hence why the screenshot. In the screenshot you see that all the changes you made, they are not there when you edit a post.

That is my alternative route but it also doens't work on the edit page I believe. Ozzy made out of it an addon and in worst case I am gonna use that. But I guess you guys didn't test it well because it is not responsive (I reported it). I think with 1 line of css tweak it becomes responsive though. But I prefer a solution where I don't touch any templates because with each upgrade I fear something will break and one more addon to look after.
 
Last edited:
Top Bottom