1

Can I get all the fields of a section? For example, I have channel events, I want the fields in that section, but not related to any specific event.

I want to know all the fields (not the values), before actually executing the query.

1

You can't get the fields from a section since sections have no field layout. Sections have several entry types and those are responsible for the fields.

$entryType->getFieldLayout()->getFields();

You can get all types in a section with

$section->getEntryTypes();
  • But a section with a handler has a fieldLayout, right? Like the layout of the section 'news'. Which is different of the section 'event' – Jorge Anzola Jun 22 '18 at 15:28
  • Nope, the field layout is attached to the entry type that is connected to the section, never to the section itself – Robin Schambach Jun 22 '18 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.