Lack of interest Force carriage return before & after inserting photo/attachment

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

Floyd R Turbo

Well-known member
There are nearly zero instances where this should not be done. Inserting an attachment inline with text is the exception, not the rule. However, I find myself more often than not "cleaning up" other people's posts when they have inserted pics into a thread and don't hit return on either side of it

Suggesting "training" users to do so is not acceptable.

Would this be something simple to do manually? It's the little things that make the difference...
 
Upvote 6
This suggestion has been closed. Votes are no longer accepted.
There are times when I, and others on my site, insert more than one image on the same line deliberately, it's useful when you can fit 2 or more on the same line rather than a very long column of images. In this instance it would be undesirable to have auto carriage returns.
 
I think that some experienced users can deal with the way it currently works, no problem. They know how it jams a pic in the middle of text if you don't put it on it's own line, so they have trained themselves to press enter 2x, insert pic, press enter 2x.

But the vast majority of users on my sites upload pics and insert all wherever their cursor lies, and they are completely unaware of the ability to view bbcode vs rich text, never mind even knowing what they are looking at necessarily

Add to that, it doesn't look like anything is wrong on mobile, because there's not enough screen width on mobile to jumble text and pics on the same line. So someone who posts via mobile, their post looks horrible on PC

There has to be a way to hack around this, give the end-user an option, or make it an ACP option of some kind.

There are times when I, and others on my site, insert more than one image on the same line deliberately, it's useful when you can fit 2 or more on the same line rather than a very long column of images. In this instance it would be undesirable to have auto carriage returns.
Then I could see where you would not want it, but that seems specific to your group. Which sounds like they are experienced forum users that are aware of how the site arranges post content, and people are OK with taking the time to make their posts look the way they want.

My point is, this is just not the case for more forum users. They expect it to work quickly and easily and don't want to spend time making it look pretty. It should do it without them having to remember 6 steps to inserting a picture and not making it end up in the middle of a sentence.

^^ I don't say that to sound rude or sarcastic. This is the type of feedback I get or see from others about ease of use - literally, people don't want to have to learn how to use things, they want them to be intuitively easy to use...that's all. It's important!
 
I think forcing a carriage return after is sufficient.

Example of what we have now:
Code:
[ATTACH=full]100[/ATTACH][ATTACH=full]101[/ATTACH][ATTACH=full]102[/ATTACH]


Forcing a blank line after the attachment is what I think we need:
Code:
[ATTACH=full]100[/ATTACH]

[ATTACH=full]101[/ATTACH]

[ATTACH=full]102[/ATTACH]

Thank you.
 
Need one before. This prevents an image at the end of a line of text.

If the net result is 2 lines between images, so be it. To me that's better than an image ever occurring alongside a line of text
 
Need one before. This prevents an image at the end of a line of text.

If the net result is 2 lines between images, so be it. To me that's better than an image ever occurring alongside a line of text

Sometimes it's needed to place images directly below text. I think having two blank lines between inline attachments would be very bad.
 
I disagree. not having a blank line between text and a photo can actually make one miss the text.

Blank line vs carriage return are 2 different things though. A simple carriage return to a new line would mean a photo is directly below the text, without a full blank line, which is actually 2x returns. Then, 2x returns after

Example of photos inline with textmap6.webpand text after

photo with text directly beneath (no extra line, but a return)
13055165_1128168830538026_1764056151767115812_o.webp
then with text right after and then anther photo
puppies.webp

but if I add 2 line breaks it looks better

DSC04120 - 50%.webp

The flow is much better when there is a full empty line immediately before and after a photo

now here is insert all full image with no return. In the case where the pic is large enough, it gets it's own line but there is little space in between13055165_1128168830538026_1764056151767115812_o.webppuppies.webpDSC04120 - 50%.webpmap6.webpand this text might not be seen well

here's the code from the above post
Code:
Example of photos inline with text[ATTACH=full]156535[/ATTACH]and text after

photo with text directly beneath (no extra line, but a return)
[ATTACH=full]156532[/ATTACH]
then with text right after and then anther photo
[ATTACH=full]156533[/ATTACH]

but if I add 2 line breaks it looks better

[ATTACH=full]156534[/ATTACH]

The flow is much better when there is a full empty line immediately before and after a photo

now here is insert all full image with no return.  In the case where the pic is large enough, it gets it's own line but there is little space in between[ATTACH=full]156532[/ATTACH][ATTACH=full]156533[/ATTACH][ATTACH=full]156534[/ATTACH][ATTACH=full]156535[/ATTACH]and this text might not be seen well
 
We might be saying the same thing. Take for example a new message with two attachments uploaded, when I click the Insert all button I would like to see this:

Code:
[ATTACH=full]100[/ATTACH]

[ATTACH=full]101[/ATTACH]

Notice how the first attachment is at the top, then the second attachment has an empty line. The second attachment has the empty line removed when the message is saved.
 
Yep a noticed that, your mod works well with 2 attachments back-to-back. At minimum, this is what I'm going for

If there was a way to also have a blank line before and after when text wrapped the attachment, that's ideal. But if that meant 2x blank lines between pics, not perfect, but ok

If double-returns would be automatically removed, problem solved. But I don't think it works that way otherwise that would apply everywhere and...



I couldn't do this ^
 
A good solution to this was posted
https://xenforo.com/community/threa...ine-break-s-after-attach.132766/#post-1169600

There wouldn't be a direct way of changing how they're inserted. You could potentially adjust the bb_code_tag_attach template and wrap the output in a <div>...</div>, though you'll be forcing each attachment to be displayed on its own line which may not be desirable.

Yes, just literally wrap the entire template in a <div> (and then </div>). Note that this won't apply during editing/posting though.

That's actually perfect....I can apply my "default" preferences and then if someone wants their own format, they can modify it. Thanks!!!

So just mod the bb_code_tag_attach template to read this:

Code:
<div>
<br />
<xen:if is="!{$validAttachment}">

    <a href="{xen:link full:attachments, $attachment}" target="_blank">{xen:phrase view_attachment_x, 'name={$attachment.attachment_id}'}</a>
    
<xen:elseif is="!{$attachment.thumbnailUrl}" />

    <a href="{xen:link full:attachments, $attachment}" target="_blank">{xen:phrase view_attachment_x, 'name={$attachment.filename}'}</a>
    
<xen:elseif is="{$canView} AND {$full}" />
    
    <img src="{xen:link full:attachments, $attachment}" alt="{$attachment.filename}" class="bbCodeImage LbImage" />
        
<xen:elseif is="{$canView}" />
    
    <a href="{xen:link full:attachments, $attachment}" target="_blank" class="LbTrigger"
        data-href="{xen:link misc/lightbox}"><img
        src="{$attachment.thumbnailUrl}" alt="{$attachment.filename}"
        class="bbCodeImage LbImage" /></a>
            
<xen:else />

    <a href="{xen:link full:attachments, $attachment}" target="_blank"><img src="{$attachment.thumbnailUrl}" alt="{$attachment.filename}" class="bbCodeImage" /></a>
    
</xen:if>
<br />
</div>
Which works. However oddly enough as @Mike mentioned that such formatting would not survive edits (maybe that's not what you meant?) it actually does survive persistently. You can't remove the carriage returns
 
After playing around with this a bit, it also affects existing posts. So in essence, it retroactively fixes the issue, but that can also cause excess line breaks to appear. You can edit the BB code to look like this

Code:
[ATTACH=full]100[/ATTACH][ATTACH=full]101[/ATTACH]

...and when it posts, it appears as though the code has been changed to this

Code:
[ATTACH=full]100[/ATTACH]

[ATTACH=full]101[/ATTACH]

But it actually hasn't done anything to the inserted bbcode. So when you have already edited someone's post and added line breaks between the attach code like this

Code:
[ATTACH=full]100[/ATTACH]
[ATTACH=full]101[/ATTACH]

You (in my case) get 3 full line breaks between pics, and if you did a double before the first pic and after the second, or between pics, there's more space.

So it's not perfect. What would be ideal is if the line breaks were actually added on either side of the attachment and placed into the post itself, once and only once, when the post was created. This appears to apply when the post is processed for display (hence why it works everywhere, immediately.

Also this work when using @AndyB's mod to this same template that allow pics to show up in quoted posts; for this mod, you comment out the entire template and use this instead

Code:
<img src="{xen:link attachments, $attachment}" alt="{$attachment.filename}" class="bbCodeImage LbImage" />
So wrapping div tags around that does the exact same thing
 
Back
Top Bottom