Skip to main content
Topic: Less space between attachments (Read 8582 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Less space between attachments

Hello!

I would like to have less space between the attachments in a post and the informations about the pictures should not need 3 lines.
I can remember I did this once (in BoardIndex.template?) but with some syntax error. O:-)

Now I have just resized the font a little, but there is still a lot of space between the pictures.

Code: [Select]
.attachments, .custom_fields_above_signature {
    border-top: 1px solid #436d94;
    font-size: 0.8em;
}

Is there a possibility to make a change in CSS to set the informations about the attachments in a single line?

It should look like the second picture.

Re: Less space between attachments

Reply #1

Site URL? Theme used? Resolution?
~ SimplePortal Support Team ~

Re: Less space between attachments

Reply #2


Why do you need to know? Site Url is a secret. ;)

And the resolution should not matter, the informations about the attachment in a single line, as I would like to have it, should always stay the same, in any resolution.



It is the Default, the Light-Theme, with some changing.

Re: Less space between attachments

Reply #3

I found it in Display.template.php on line 878 and changed it to this:

Code: [Select]
	, ', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ', ' . sprintf($txt['attach_viewed'], $attachment['downloads']) : ', ' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), '

This time without syntax error. ;) It is looking better now to me.

Re: Less space between attachments

Reply #4

Why the heck did I lost this one? :'(

Sorry! :-[

BTW, looking for a way to obtain almost the same result without touching the template, you could try with a simple css trick:
Code: [Select]
.attachment_name br:after {
    content: ' ';
}

.attachment_name br {
    content: ' ';
}
.attachment_name {
    word-break: normal;
}
that forces the br to behave like a space.
The "word-break" is to avoid oddities in certain cases. ;)
Last Edit: April 30, 2016, 06:52:15 am by emanuele
Bugs creator.
Features destroyer.
Template killer.

Re: Less space between attachments

Reply #5

Thank you very much, Emanuele!  :) I have changed it. It is much better that way.

I really love it, that things like this can be done in CSS.
(If you know, how to do it) ;)

Re: Less space between attachments

Reply #6

:D
Bugs creator.
Features destroyer.
Template killer.

Re: Less space between attachments

Reply #7

It is only working in Opera, Emanuele, I did not notice it before.

My users asked me, if they can get the attachments centered, so I changed it for them and afterwards I had a look at the attachments in Opera, Firefox and IE.

See the difference:

Re: Less space between attachments

Reply #8

Apparently it doesn't work reliably cross-brower... a bad trick. :(
Bugs creator.
Features destroyer.
Template killer.

Re: Less space between attachments

Reply #9

Code: [Select]
.attachment_name br { display: none; }
This should kill the spaces, but I am not sure about other implications, as it looks a bit different from the regular Light.
~ SimplePortal Support Team ~

Re: Less space between attachments

Reply #10

Thank you very much,  Flavio. I have tried it. It looks nearly the same as it was by using Emanueles trick.
And it only works in Opera, not with Firefox or IE, too.

I think, I will make this change in Display.template.php again. It should work for all browsers, as I believe?
It would be the only change in default, I did not touch it for anything else until now.

Our theme is not this much different to the light theme, Flavio. Just a bit more of color and many, many icons as smileys. ;)

Re: Less space between attachments

Reply #11

No! It worked that way, Flavio! Great.

I uploadet (uploaded?) an older version first, without this changing. O:-)

It looks fine in all browsers now.

Re: Less space between attachments

Reply #12

Except there is (for sure) no space between the size and the "viewed" part. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Less space between attachments

Reply #13

Yes...there was no space between the size and the last part, Emanuele.

So I did this in index.german.php:

Code: [Select]
$txt['attach_viewed'] = '%1$d-mal angesehen';

changed to:

Code: [Select]
$txt['attach_viewed'] = ' %1$d-mal angesehen';

A little space there is working fine. ;)

Re: Less space between attachments

Reply #14

Great :)
~ SimplePortal Support Team ~