Skip to content

Sanitize HTML output and increase size of Body textarea input fields (CFM-62) #293

Merged
merged 2 commits into from Feb 13, 2025

Conversation

arlen
Copy link
Contributor

@arlen arlen commented Feb 12, 2025

No description provided.

] as $field) {
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => $field
]]);
}

$afterField =
Copy link
Contributor

@Ioannis Ioannis Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you make the afterField a simple element? If this is specific to the MostlyStaticPages, then the element could be under the folder mostlyStaticPages and be named as afterField.php. Since this is static, we can also cache it. The way we do with other static elements as well.
Currenlty we have several static elements already. The footer, form/requiredSpan, notSetDiv, etc. We could also create a directory call staticElements and move all of these element under that directory.

      // Add a hidden field
      $element = $this->getView()->element('form/notSetDiv', [], [
        'cache' => '_html_elements',
      ]);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not the purpose of afterField and beforeField: the purpose of these is to supply arbitrary markup before or after any field. This allows for arbitrary dom elements (for display) and arbitrary JavaScript (for interactivity). This provides flexibility that elements don't provide on a per-field basis.

(Note: these features need to get into the documentation.)

@Ioannis Ioannis self-requested a review February 13, 2025 14:44
@arlen arlen merged commit 5f2e01d into COmanage:develop Feb 13, 2025
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants