Skip to content

Setting a layout variable into channel form {custom_fields} loop doesn't work #200

Closed
@pixiwooh

Description

@pixiwooh

Description of the problem
Issue tested on 2 different installations.

In a channel form, I try to store each {field_name} into a {layout:set:append} variable list so I can loop through this list into the wrapper layout template and dynamically show some stuff based on the fields name.

`{exp:channel:form channel="mychannel" entry_id="{segment_3}"}

{custom_fields}
{layout:set:append name='lv_the_fields_name'}{field_name}{/layout:set:append}
{/custom_fields}

{/exp:channel:form}`

The {layout:set:append name='lv_the_fields_name'}{field_name}{/layout:set:append} is not being parsed. For each custom field of the loop I got {layout:set:append name='lv_the_fields_name'}my_field_name_well_parsed{/layout:set:append}

My end goal is to show into the wrapper layout a sliding help panel for each custom field, like this :
{layout:lv_the_fields_name} {embed="modify/_help_panel_{value}"} {/layout:lv_the_fields_name}

But since the custom field's names are not append to the layout variable array, I can't.

How To Reproduce
Steps to reproduce the behavior:

  1. Create a channel form
  2. Loop through the fields with {custom_fields} tag.
  3. Try to show the the names of the custom fields with {field_name} to be sure it works.
  4. Create a dynamic list layout variable between the {custom_fields} tags with {layout:set:append} tag pair to store every field name
  5. You should see the layout:set:append tags not parsed (but the fields names well parsed) in the front-end
  6. In the wrapper layout used : impossible to show the values of the dynamic list layout variable.

Error Messages
/

Environment Details:

  • Version: 5.2.2
  • PHP Version 7.1.18
  • MySQL Version 5.0.12-dev
  • OS: Windows
  • Web Server: Apache

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions