Skip to content
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

Data director adds own path formatter to all relations. #106

Open
ascheider opened this issue Jul 6, 2023 · 4 comments
Open

Data director adds own path formatter to all relations. #106

ascheider opened this issue Jul 6, 2023 · 4 comments

Comments

@ascheider
Copy link

I have currently the problem with data director: 3.4
@DataDirectorSearchViewPathFormatter is always added as formatter class if you save a class or rebuild classes.

image

How can i prevent it?

@BlackbitDevs
Copy link
Collaborator

Of course this is an opinionated feature.
First question: You are the first who dislikes it and prefers Pimcore's default formatter (with full path). The DataDirectorSearchViewPathFormatter automatically shows the fields of the referenced items' class which are configured to be shown in search. Imho, most of the times this is a far better default than the full path.

Here is an excerpt from the DD manual:

Path formatter

Relational fields support path formatters to define the display of the related item. Data Director comes with a universal implementation which uses the fields of the related item, which are configured to be shown in the search view, also in the relation field view. To use this, set Formatter service / class of the relational field to @DataDirectorSearchViewPathFormatter.

This gets done automatically for all relational fields which do not have a Formatter service / class. If you prefer to show the full path of the related item (= Pimcore's default display of relations), please use @DefaultPathFormatter.

If you prefer to show the fields which are configured to be shown in the grid view, you can use @DataDirectorGridViewPathFormatter.

@ascheider
Copy link
Author

@BlackbitDevs Thanks for your feedback.
I have a class with relations to another objects, where i show id and path:
image
After data director applies formatter, i have this output:
image
The path output is somehow broken and outputs 1 - 1

@ascheider
Copy link
Author

@BlackbitDevs @DefaultPathFormatter works fine and i have output like before. Thanks!

@BlackbitDevs
Copy link
Collaborator

@BlackbitDevs Thanks for your feedback. I have a class with relations to another objects, where i show id and path: image After data director applies formatter, i have this output: image The path output is somehow broken and outputs 1 - 1

Which fields are configured to be "visible in search result" for class PriceListGroup and PriceListPropertyGroup? And of which type are they?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants