Skip to:
Content
Pages
Categories
Search
Top
Bottom

Is there a way to add a max width to images or remove dimensions field in image box in BP-TinyMCE?

  • Avatar of ewebber
    ewebber
    Participant

    @ewebber

    Hi,
    I’ve added “image” to my list of buttons, so users can add image urls to embed images into forums, but I need to try and restrict the image width to 550px so it fits in with my theme. Does anyone know a way of doing this?
    Thanks
    Emily

Viewing 11 replies - 1 through 11 (of 11 total)
  • Avatar of Mark
    Mark
    Participant

    @markhahnel

    Hi Emily,

    Can you share how you did this?

    Thanks

    use css: max-width: 550px;

    Avatar of ewebber
    ewebber
    Participant

    @ewebber

    @markhahnel it was just a case of updating bp-tinymce.php
    `theme_advanced_buttons1` to include: image

    @ezeke that was the first thing I tried but it doesn’t really work as tinymce gives the images a height, so it just seems to change the dimensions.

    The other thing I could do is remove the ability to set the dimensions, if anyone can help with that

    Avatar of ewebber
    ewebber
    Participant

    @ewebber

    OK, looks like I need to go into the /wp-includes/js/tinymce/themes/advanced/image.htm file to make these changes

    Avatar of ewebber
    ewebber
    Participant

    @ewebber

    still no further, can anyone help?

    Avatar of claudeg
    claudeg
    Participant

    @claudeg

    @ewebber thanks for this, it almost work for me…
    I’ve put image on line 51 of bp-tinymce.php. Then I was able to upload a photo in a comment with the specified dimension (have to take care of the ratio) and write some text. But when I’ve tried to post my comment, it says something like the field was empty, to post something in this field (everything was in french you know!!!)
    So I must miss something somewhere…

    Update: It works everywhere exept in bp-gallery photo comments (old version, I’ll try with the last release)

    Avatar of ewebber
    ewebber
    Participant

    @ewebber

    @claudeg did you find a way to specify a default dimension?

    Avatar of claudeg
    claudeg
    Participant

    @claudeg

    Hummm… I just had to specify it in the dialog box:

    capture ecran

    Avatar of ewebber
    ewebber
    Participant

    @ewebber

    @claudeg – I am looking for a way to remove the dimensions box or set a default size, which is why I started this topic

    Can anyone else help me? @boonebgorges – can you help at all

    Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    @ewebber – Did you do what Ezeke suggested? Worked for me on forums:
    .post-content img { max-width: 400px; height: auto }

    Avatar of ewebber
    ewebber
    Participant

    @ewebber

    @boonebgorges thanks, I can try to work with CSS cross browser, but I’ll need to find the right class/div that doesn’t effect the blog posts – just a case of fiddling around a bit. I’m really interested to know if there is a way that users can embed images in posts without being presented with a load of options – they just need to use the image url and an alt tag rather then align it or use a class. As this plugin hooks into wordpress’ TinyMCE editor than it may just not do what I am after. I will continue the search.

Viewing 11 replies - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.