-
Improvement
-
Resolution: Obsolete
-
Major
-
None
-
0.5
-
None
I see in many scripts parts which are either too complicated or do not use scripting best practices.
This should be changes to make the readability and understandability much better.
One example (textImage.ftl):
Original
[#assign headingLevel = "h2"] [#if content.headingLevel?has_content] [#assign headingLevel = content.headingLevel] [/#if] [#if content.headline?has_content] <${headingLevel}>${content.headline!}</${headingLevel}> [/#if]
Replacing with (using properly "!"):
[#assign headingLevel = content.headingLevel!"h2"] [#if content.headline?has_content] <${headingLevel}>${content.headline}</${headingLevel}> [/#if]
Better would be even delegating to the parameters def the default heading level.
Like this more variations could be created using a different default heading level:
[#assign headingLevel = content.headingLevel!def.parameters.defaultHeadingLevel!"h2"] [#if content.headline?has_content] <${headingLevel}>${content.headline}</${headingLevel}> [/#if]
Acceptance criteria
- is superseded by
-
MTE-20 Don't store html elements in website workspace, use named/speaking headlineLevels instead
- Closed