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
Comment #1
ufku commented#319653: auto-resize or max width for external images to avoid breaking themes?
Comment #2
v8powerage commentedThat'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?
Comment #3
ufku commentedAdding 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.
Comment #4
v8powerage commentedThanks, that's what I wanted, not sure how to make this value checking with eDefTagDialog though.