The TV is created fine, but no input properties are added.
tvs:
- name: blog_image
file: blog_image.tpl
caption: "Blog Image"
type: imageplus
description: "Main image for blog posts"
category: blog
input_properties:
- name: targetWidth
type: textfield
value: "1200"
- name: targetRatio
type: textfield
value: "16/9"
Does it work if you use the key inputOptions
instead of input_properties
?
'inputOptionValues' => [Rules::isString],
'outputType' => [Rules::isString],
'category' => [Rules::isArray, Rules::categoryExists],
'file' => [Rules::isString, Rules::notEmpty, Rules::elementFileExists],
'properties' => [
['rule' => Rules::isArray, 'params' => ['itemRules' => [Rules::configPart]]]
],
'propertySets' => [
['rule' => Rules::isArray, 'params' => ['itemRules' => [Rules::isString, Rules::propertySetExists]]]
],
'inputOptions' => [Rules::isObject],
'outputOptions' => [Rules::isObject],
'templates' => [Rules::isArray, Rules::templateExists],
];
protected function generator(): void {
parent::generator();
if ($this->defaultValue !== null && $this->content === null) {
$this->content = $this->defaultValue;
}
halftrainedharry:
inputOptions
No it does not sadly.
“TemplateVar: blog_image - inputOptions - 0 has to be string, integer given.”
Ahh this works:
inputOptions:
{ "targetWidth": "1200", "targetRatio": "16/9", "allowBlank": "false" }
system
Closed
May 30, 2025, 12:58pm
5
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.