Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Insert Image in CMS (tinymce) SS2.2

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2 3
Go to End
Author Topic: 5603 Views
  • dio5
    Avatar
    Community Member
    501 Posts

    Insert Image in CMS (tinymce) SS2.2 Link to this post

    When inserting images with tinymce in SS2.2 I'm getting weird results.

    Just inserting it from the right 'image' tool setting style to 'left with wrap' description to 'test' gives me:

    <img class="left" src="assets/Uploads/_resampled/ResizedImage333222-image.jpg" alt="test" title="null" align="null" height="222" hspace="null" vspace="null" width="333" />

    - Title: null??
    - What's all that hspace vspace crap doing in there? (null is not even an allowed value).

    Then I noticed that I could right-click on the image in the content area and get a popup.
    So I cleared the 'null' values, just erased them.

    Hooray vspace - hspace all were gone.

    But : the class was gone too, and the title had changed from null to undefined...

    Isn't there a way to just have a title, an alt and a class without all the other crap and without having to right-click?

    ( and without having to break into the core again making upgrading a pain in the .. )

    I'd rather have a simple but correct tool than 10000 fancy features that get messy.

    cheerz

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Insert Image in CMS (tinymce) SS2.2 Link to this post

    I can confirm this behavior. Dio : did you already put it into TRAC ?

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Insert Image in CMS (tinymce) SS2.2 Link to this post

    No, noticed it just 5 minutes ago..

    ( I'm building my second SS-site, but now for someone else who will want to insert images...)

    Shall I make a ticket for it?

    I really need this to be working correct.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Insert Image in CMS (tinymce) SS2.2 Link to this post

    I wonder if this is SS-behaviour or just a 'defect' of tinymce?
    If it's tinymce, I think we're f*d.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Insert Image in CMS (tinymce) SS2.2 Link to this post

    A possible solution for the hspace vspace align - stuff disappear:

    Erase hspace - vspace - align in cms/javascript/tinymce.template.js

    That would make the right click - image properties quite unuseful and broken, but leaves out the crap.

    Doesn't solve the 'title' issue though.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Insert Image in CMS (tinymce) SS2.2 Link to this post

    Maybe 'title' should just be left out too... An alt on an image is usually enough.

  • Maarten
    Avatar
    Community Member
    4 Posts

    Re: Insert Image in CMS (tinymce) SS2.2 Link to this post

    The solution:

    find jsparty/tiny_mce_improvements.js

    locate the line (665 here):

          TinyMCE_AdvancedTheme._insertImage(relativeHref, altText, 0, null, null, $('Form_EditorToolbarImageForm_Width').value, $('Form_EditorToolbarImageForm_Height').value, null, null, null, null, cssClass);

    and replace it with

          TinyMCE_AdvancedTheme._insertImage(relativeHref, altText, 0, null, null, $('Form_EditorToolbarImageForm_Width').value, $('Form_EditorToolbarImageForm_Height').value, null, altText, null, null, cssClass);

    (the third last null (=title) is replaced with the altText).

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Insert Image in CMS (tinymce) SS2.2 Link to this post

    Nice.

    Alternatively, title can just be left out of line 44 in cms/javascript/tinymce.template.js
    (together with hspace, vspace, ... )

    (That removes the title entirely though.)

    5603 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.