Legacy feature support in new stack user siteaccess usage #2
We again thank you for your fantastic solution! We took a moment to continue the work we started in #1
This pull request depends on #1 being merged first. Please merge the first pull request and then consider merging this pull request.
During the course of a normal share forum thread, http://share.ez.no/forums/ez-publish-5-platform/select-class-attribute-option-values-ez-5.4
We found several inconsistencies between the default legacy template feature support and the current new stack feature support. Basically the current new stack template can only display selected option identifiers and not the selected option names. I think we can agree that displaying option names is much more user friendly than only identifiers.
In general template logic (and underlying features) were quite different and also did not support the use of custom delimiter display.
The reason for the original limitations in the provided bundle was because the provided FieldType FieldValue Converter was so basic it did not provide support for the use of FieldSettings to the template layer with the stored ContentType Field settings.
In general we borrowed code and syntax for these additions for the default selection FieldType as a guide and customized provided FieldType FieldValue Converter using the legacy datatype's features (but not syntax) also as a guide (as required; not needed).
We have extended the solution in general to provide the same default user siteaccess features as legacy. We think this represents a substantial improvement to the new stack bundle that all user can benefit from, right out of the box! And while we have not ported all features of the legacy datatype specifically since eZ Platform UI is still alpha and feature incomplete (in terms of Content Type definition administration)... we think that our improvements provide a solid basis for current users trying to get the same features provided by the legacy datatype's default use provided feature set in a user siteaccess context and future developers extending the solution further (when eZ Platform UI does provide for Content Type definition administration).
This pull request solves issues surrounding different default use feature support.
We hope that you agree and will merge our improvements!
Note: This is our very first attempt at custom FieldType and Twig template bundle improvements based on legacy datatype and eztpl features. Please be gentle if we have made any errors or omissions :)
Please let us know how this finds you.
Take it eZ!
Once again, thanks for this pull request :) Sorry for being late with the review, but you know how it is, client projects always come first :)
I've made some remarks on your code so check them out in your own time. If you don't have time to correct the issues, let me know, I'll merge the pull request and correct them.
We have addressed your comments and concerns with some further improvements.
Please review our improvements and let us know what you think.
Note: We are considering further refactoring (in a separate PR #3 to provide a default template solution to sort the displayed selection options by priority (as stored / used in the FieldType options). We welcome your thoughts on this since we would require a twig filter to sort the fieldSettings options by 'priority'.
Apologies for the previous confusion. I have made the changes you suggest as they are what makes more sense and more readable.
I made one other change for simplicity of the potential user who creates a template override which does not want or need a space after the delimiter. I moved the space following the delimiter which was in the template logic into the default delimiter set statement instead.
I also made one other addition to the documentation to clearly explain the last undocumented step to getting their selection content displayed within their own custom template.
I have also merged this change into our other PR #3.
If you like I can flatten all of this PR's changes into a single commit.
…upport for custom FieldSettings values to provide for new stack user siteaccess feature sets to match legacy user siteaccess provided template features and expanded documentation