0
votes

I don't want my users to position/float the images they add via Redactor but I do want them to give them a title.

I tried setting observeImages to false but this removed the title (and delete) option. I just want to remove the position drop-down.

I'm using Redactor with Statamic so I don't have a client account to ask for help directly.

2

2 Answers

0
votes

The easiest option you have is to find these lines in redactor.js, and hide them with inline css. It will preserve the state of the image float.

+ '<label>' + this.opts.curLang.image_position + '</label>'
+ '<select id="redactor_form_image_align">'
    + '<option value="none">' + this.opts.curLang.none + '</option>'
    + '<option value="left">' + this.opts.curLang.left + '</option>'
    + '<option value="center">' + this.opts.curLang.center + '</option>'
    + '<option value="right">' + this.opts.curLang.right + '</option>'
+ '</select>'

Starts at line 7164 in my unmodified v9.2.2.

If you just remove those lines redactor will always set the image float to default. As well the margin and display too. But you can tweak that behaviour in the imageSave method. (#6700)

$el.css({ 'float': '', 'display': '', 'margin': '' });
0
votes

I realize that you are no longer using Redactor for your solution, but I wanted to post this setting from Redactor's current documentation in case others were looking for this solution:

$('#redactor').redactor({
  imagePosition: false
});

This should disable the image position dropdown. http://imperavi.com/redactor/docs/settings/images/#setting-imagePosition