1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Force image to be on own line

Discussion in 'Resource and Add-on Requests' started by Floyd R Turbo, Sep 2, 2014.

  1. Floyd R Turbo

    Floyd R Turbo Well-Known Member

    I don't know if this is even remotely possible, but it's one thing that I've found rather annoying.

    Whenever someone posts a picture, whether that be an attachment or a IMG code BB link, etc, there are some people that don't understand that unless you actually hit return before and after the picture, their post will look like a jumbled mess with the text preceding the pic/thumb inline or running on right after it.

    So is there any way to automatically force an image to be on it's own line? Without messing up a bunch of other stuff?

    I think this is mainly a "user education" thing but it really surprises me how many people don't seem to get this simple process for making a post look clean and readable.
  2. Robust

    Robust Well-Known Member

    Sometimes I'd want an image on the same line. For example [​IMG]
    Floyd R Turbo likes this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    If you're accepting of the repercussions as outlined above by Robust then you can handle this with CSS. EXTRA.css:

    .messageContent .messageText img
        display: block;
    You could also add some more code here to give it a bit of spacing.
    Floyd R Turbo and Robust like this.
  4. Floyd R Turbo

    Floyd R Turbo Well-Known Member

    Yeah I had considered that @Robust and that is definitely not something I would want to happen. That wouldn't be an issue with XF built in smilies though.

    I was thinking of a way to maybe make it a "smart" filter. For instance, code that would be able to process BB code of only a certain structure. Like the word ATTACH for XF attachments, or something that looks for IMG code but only from certain sites like photobucket or dropbox or shutterfly, things that would most prevalently be photos.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Sounds like a very niche function to me.

    I definitely wouldn't want post content on my site manipulated in that manner.
  6. Robust

    Robust Well-Known Member

    I think a more suitable way to do it would be to check if the image height is larger than the height of that row of text, so if you have increased text size it'd check it against that, otherwise against the normal size. If it's larger than put it onto a new row automatically. I think that's a friendly way to do it, that is if this got implemented.
  7. Floyd R Turbo

    Floyd R Turbo Well-Known Member

    Hmmm that's interesting. Hadn't thought of the determining factor being size. Good call @Robust
  8. Floyd R Turbo

    Floyd R Turbo Well-Known Member

    I wondered if you had mis-typed this originally (as "would")

    What would the reason be for why you would not want to have this done, just out of curiosity?

    This thread may be better placed in the addon requests sub-forum, if anyone can move it for me that would be appreciated
  9. Brogan

    Brogan XenForo Moderator Staff Member

    Sometimes I prefer to have images inline with the text.
    Other times I prefer to float them and wrap the text.

Share This Page