-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Automatic grids from section objects #1582
Conversation
eb6e95a
to
3f6dc05
Compare
This should work now, but has a bit of odd behavior:
The array of existing objects that is received by the user function unfortunately does not contain all objects until you've saved - but does contain one object if the list of objects was previously empty. Go figure - but that's how it works... We will need the JS solution to update these field values somehow. I can provide the next save colPos value to use - but the JS has to then increment this when new objects are created in the section. |
Hidden field for column position and input field for label are added automatically if |
de5cae4
to
58c7f3d
Compare
Is it intentional to make the label mandatory? Depending on the type of CE, it might not make sense to put labels on the content areas and it would be better number them (like "Content Area #1") automatically. |
The label is optional (but the field will always be there, perhaps that's what you meant?). Regarding automatic numbering that comes with the same challenge as the colPos value and the thing this patch attempts to solve - if you move an object in the section, the numbering changes. Outputting the colPos value as label happens if you don't fill the name/label field. I mostly added it so that all the fields that have a special functionality based on their name (colPos, name) will also have an automatically added form field. The one thing you can't do from within a template is remove this field (that would require a custom Provider or usage of Flux hooks), but if you declare another field with that name, that field will replace the automatic one (logic sequence: is-content-container gets set on section object, fields get added when setter is called, any subsequent additions of a field with the same name replaces that field). |
58c7f3d
to
f32786d
Compare
Adds a flag for section objects to make each object that gets saved in the section, a content container column in the page layout view. Example Form with section-objects-as-grid: <flux:form id="sectionObjectsAsGrid"> <flux:form.section name="objects"> <flux:form.object name="main" contentContainer="1"> <flux:field.input name="test" label="Test" /> </flux:form.object> </flux:form.section> </flux:form>
f32786d
to
5955794
Compare
How it is possible to render the content of the grids? Thanks for your support! |
worked for me. |
Adds a flag for section objects to make each object
that gets saved in the section, a content container
column in the page layout view.
Example Form with section-objects-as-grid: