Skip to content

Commit

Permalink
Add editable param to area helper
Browse files Browse the repository at this point in the history
  • Loading branch information
eschleb committed Dec 18, 2023
1 parent 9896fc3 commit e5f04b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Parameters:
|----------|-----------|-----------
| name | String |Name of the area element
| area | String |Name of the area definition node such as ContentArea, Footer or Stage.
| editable | boolean |By setting the value to false you can prevent area editing.

Additional key-value params are added to the context. Can be used to pass key-value pairs to components inside this area.
#### supplier-page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public Optional<CharSequence> applySafe(final Object ignored, final Options opti
final String name = options.hash("name");
// area name for BE, ignored by FE
final String area = StringUtils.defaultIfBlank(options.hash("area"), name);
final boolean editable = options.hash("editable", true);

final RenderingModel<?> model = getRenderingModel(options.context).orElseThrow(() ->
new IllegalArgumentException("Rendering model not present!")
Expand All @@ -85,6 +86,8 @@ public Optional<CharSequence> applySafe(final Object ignored, final Options opti
areaElement.setName(name);
areaElement.setContextAttributes(options.hash);

areaElement.setEditable(editable);

return Optional.of(render(areaElement));
}

Expand Down

0 comments on commit e5f04b5

Please sign in to comment.