Replies: 1 comment 1 reply
-
The
In my personally opinion I even would remove the For all things which have todo with entities Here some complex example out of a project: <property name="directories" type="directory_selection" multilingual="false">
<meta>
<title>sulu_directory.directories</title>
</meta>
<params>
<param name="item_disabled_condition" value="(_permissions && !_permissions.assign)" />
<param name="allow_deselect_for_disabled_items" value="false" />
<param name="request_parameters" type="collection">
<param name="includeAssignPermissions" value="true" />
</param>
<param name="resource_store_properties_to_request" type="collection">
<param name="assignedTopicIds" value="topics" />
</param>
</params>
</property>
<property name="topics" type="topic_selection" multilingual="false">
<meta>
<title>sulu_directory.topics</title>
</meta>
<params>
<param name="item_disabled_condition" value="(_permissions && !_permissions.assign)" />
<param name="allow_deselect_for_disabled_items" value="false" />
<param name="request_parameters" type="collection">
<param name="includeAssignPermissions" value="true" />
</param>
<param name="resource_store_properties_to_request" type="collection">
<param name="assignedDirectoryIds" value="directories" />
</param>
</params>
</property> |
Beta Was this translation helpful? Give feedback.
-
I've integrated custom entities as described here: https://docs.sulu.io/en/2.5/book/extend-admin.html
I'm having a custom entity with a source property, an attribute property and a value property. All are selects. The first two properties (source and attribute) determine which options are available in the value select. I have some ideas on how to do that:
I was not able to find a way to do this using https://docs.sulu.io/en/2.5/cookbook/select-values-service.html as it seems there is no way o pass any other arguments other than a hard-coded string or the locale variable. Is that true?
Another idea was to return a (virtual) property containing an array of options in the entity JSON, so I can use them within the form but that seems not possible too.
Last but not least: add lots of
<property type="single_select">
withvisibleCondition
directives for each source and attribute combination. Not really a straight forward approach and lots of duplicate code.Anyway, this seems to be the only working idea or do I miss something?
Beta Was this translation helpful? Give feedback.
All reactions