Hi
I'm trying to add default width and height (say 320x280) to image insert, because my users are often putting really big images which are completely destroying the website's look.

How to change default bueditor image insert command code to have such a feature?

php:
$imce_url = function_exists('h') && imce_access() ? url('imce') : '';

return "js:
var B = eDefBrowseButton('$imce_url', 'attr_src', 'Browse', 'image');
var form = [
 {name: 'src', title: 'URL', suffix: B},
 {name: 'width', title: 'Width x Height', suffix: ' x ', getnext: true, attributes: {size: 3}},
 {name: 'height', attributes: {size: 3}},
 {name: 'alt', title: 'Text'}
];
eDefTagDialog('img', form, 'Insert Image', 'OK');
";

Comments

ufku’s picture

v8powerage’s picture

That's doesn't solve my problem at all, I want those values to be filled by default in edior is there some way I can do this?

ufku’s picture

Adding value: X attribute to a field will fill it with X initially, however it can easily be overridden.
If you want to do a custom form process(validating, value checking, etc) You can pass a function name to eDefTagDialog as the last parameter and implement that function in your button content.

v8powerage’s picture

Thanks, that's what I wanted, not sure how to make this value checking with eDefTagDialog though.