diff --git a/forms/TextareaField.php b/forms/TextareaField.php index 48b2ffe1e..343d5db0d 100644 --- a/forms/TextareaField.php +++ b/forms/TextareaField.php @@ -62,6 +62,10 @@ class TextareaField extends FormField { return parent::Field($properties); } + function getTemplate() { + return ($this->isReadonly()) ? "{$this->template}_Readonly" : $this->template; + } + /** * Performs a readonly transformation on this field. You should still be able * to copy from this field, and it should still send when you submit diff --git a/templates/forms/TextareaField.ss b/templates/forms/TextareaField.ss index a2a4bf6f6..27998ce3f 100644 --- a/templates/forms/TextareaField.ss +++ b/templates/forms/TextareaField.ss @@ -1,5 +1 @@ -<% if isReadonly %> -<% if Value %>$Value<% else %>(<% _t('NONE', 'none') %>)<% end_if %> -<% else %> - -<% end_if %> \ No newline at end of file + \ No newline at end of file diff --git a/templates/forms/TextareaField_Readonly.ss b/templates/forms/TextareaField_Readonly.ss new file mode 100644 index 000000000..a287b67a4 --- /dev/null +++ b/templates/forms/TextareaField_Readonly.ss @@ -0,0 +1 @@ +<% if Value %>$Value<% else %>(<% _t('NONE', 'none') %>)<% end_if %> \ No newline at end of file