XF 2.3 Disabling the attach files button?

zzlpolitics

Active member
As far as I can tell, no one on my forum is going to attach any file that isn't a picture. I assume this button is designed so people could upload videos, documents, whatever. Well, the only thing people on my forum are going to post is images. And the attach files just seems to confuse people. If you use the image button to upload an image, it actually displays the image in the post. If you use the attach files button, you have to click insert image and pick thumb or full. My users don't always get that and then have posts that are just a period to fulfill the message requirement thinking they got a pic uploaded.

So, do I have it wrong that it would simplify things to just remove the attach files button for my less than tech savvy crowd because I'm missing some other function? And also, any extra.less code to remove that button?

Thanks in advance. My eternal gratitude as always.
 
By removing things, only your avatar will remain on your forum! :D
But I like your way of seeing things: getting to the point.
Truthfully, I think my forum user average age is like 55. This software just has so many options and so much to confuse them. Worse that they migrated from maybe the worst forum software to ever exist.

But yes, thank you for helping us get to simple.
 
As your extra.less template begins to fill up, remember to comment on the code you put there, so you can find your way back later and be able to delete what you want without fumbling.

Less:
// remove the attach button
.formButtonGroup-extra .js-attachButton {
    display: none;
}

// etc.
 
@Old Nick I'm more just bringing this up to kind of get your goat but your post did hide it flawlessly the way I wanted but I just edited a post and realized it pops up when you edit a post. Are you a perfectionist and want to solve that riddle?

Screenshot 2024-08-02 233352.webp
 
My first code was imperfect. You can use this one instead.
Less:
.js-attachButton {
    display: none;
}

On the other hand, this will also remove the attachments button when sending a private message, I don't know if you want that. So with this code it will remove the button only for threads/posts.
Less:
[data-template^="thread_view"] {
    .js-attachButton {
        display: none;
    }
}
 
Back
Top Bottom