FriendsOfAkeneo / CustomEntityBundle

Eases the creation of custom entity and related views in the PIM
Other
53 stars 61 forks source link

multiple localizable fields in customEntity #197

Open jotalops opened 5 years ago

jotalops commented 5 years ago

in akeneo 1.7 this can be possible, but I can't with 2.3.

I achieve to show the two fields, but when the form is submitted, the items are not in the correct fields

this is my edit-form

## translation section1
pim-market-edit-form-properties-translation-section:
    module: pim/common/simple-view
    parent: pim-market-edit-form-properties
    targetZone: accordion
    position: 200
    config:
        template: pim/template/form/tab/section
        templateParams:
            sectionTitle: pim_custom_entity.form.tab.properties.section.description_translations
            dropZone: content

#field1
pim-market-edit-form-properties-translation-label:
    module: pim/common/properties/translation
    parent: pim-market-edit-form-properties-translation-section
    targetZone: content
    position: 210
    config:
        fieldBaseId: 'pim_enrich_group_form_label_'
        label: 'logunga'

##translation section2
pim-market-edit-form-properties-translation-section-description:
    module: pim/common/simple-view
    parent: pim-market-edit-form-properties
    targetZone: accordion
    position: 220
    config:
        template: pim/template/form/tab/section
        templateParams:
            sectionTitle: pim_custom_entity.form.tab.properties.section.test_translations
            dropZone: content

# field2
pim-market-edit-form-properties-translation-description:
    module: pim/common/properties/translation
    parent: pim-market-edit-form-properties-translation-section-description
    targetZone: content
    position: 230
    config:
        fieldBaseId: 'pim_enrich_group_form_description_'
        label: 'logunga2'

a post example ( descriptions is null but also have a value)

{"id":1,"code":"09.01","currency":"eur","locales":"cz,sk,en,us","mdmMarket":null,"webBaseUrl":"www.meneame.net","labels":{"en_US":"456"},"descriptions":{"en_US":null},"brand":{"id":2,"code":"01","name":"ROCA"}}


rimas-kudelis commented 2 years ago

Hey @jotalops, did you ever figure this out? I'm stuck with a somewhat similar problem now: I want to add a translatable "description" field to my entity, but I have no idea how to make it work so far.

jotalops commented 2 years ago

Hi @rimas-kudelis we migrate to akeneo 4 so we changed all the code to use reference entity with have this feature.

rimas-kudelis commented 2 years ago

I see, thanks.