Why Switch To Tag Processor 2?
We developed Tag Processor 2 to create a more predictable, more powerful, and more strait forward way to create complex templates with Fluent.
With the vast number of features we have added over the years, some of the original design had to be changed and this has led to buggy or unexpected behavior in certain cases and can be limited at times when creating very complex logic within Fluent templates. This was the driving factor for creating Tag Processor 2.
Tag Processor 2 has been designed with template customizability in mind. The design choices and functionality changes have been made to enable the user to create more powerful and complex templates in an easy-to-understand way.
There are two main enhancements coming to Tag Processor 2:
Refined behavior of ForEach (Expansion) Tags
Ability To Define Logic Tag Boundaries
Refined behavior of ForEach (Expansion) Tags
The primary change you will notice is around ForEach (Expansion) tags. There has been a lot of confusion around the block property for ForEach tags as well as some functionality changes over the years, so we decided to make the behavior more straightforward. There is no longer a block property for column-expanding ForEach tags. The area of expansion is now defined by the placement of your ForEach and End-ForEach tags. In addition to that, the behavior between block and non-block row-expanding ForEach tags is much more well defined. We've also included detailed messages for invalid cases so when a template is designed in an unsupported manner, the user will be notified of this immediately rather than having to go through the documentation or support processes to find this information out.
Ability To Define Logic Tag Boundaries
Another large enhancement is around Logic tags (i.e. If/else-tags, Switch/case tags). We've expanded the power of Logic tags allowing for different ordering just like ForEach tags. While we've maintained the existing Logic tag functionality, we've added additional ordering types (row and block) that allow the user far more control for what is hidden or shown by these Logic tags. These tags can be combined with the variety of ForEach tags and empower the user to create complex templates in a simple manner.
There will be a bit of a transition from Tag Processor 1 template to Tag Processor 2 templates to match the new format for ForEach tag layout, however we will still be offering Tag Processor 1 as an output option for those cases while you are undergoing the migration process for your existing templates. It is highly recommended to update templates to the new Tag Processor 2 as this will be receiving all our future support and, despite having some differences, will make your template creation experience much cleaner and more straightforward going forward and will lead to less issues and unexpected behavior.
Changes from Tag Processor 1 to Tag Processor 2
The changes have been organized into seperate articles which can be found in the sidebar or below: