Adding A Bloomreach User Reference To A Document Type

Hello, everyone.

I’m defining a new custom document type for my project that, among other things, requires an associated User reference field.

Having checked the available field types in the right margin as I edit this document type within the CMS > Content perspective, I am unable to locate a field type whose purpose is to reference a User (i.e. say, a user picker field).

One thought that crossed my mind is to use a String primitive field in which to store the User.username. But I worry this is not a sound approach. (For example, someone could go into the cms/console and change the username for a user, as it’s the name of a node under “/hippo:configuration/hippo:users”. The references from existing document instances would then point to a non-existing user.) Regardless of that, I imagine there must be a convenient/proper way to add a User field to a document type.

Might anyone know a manner in which to implement a User reference as described here? Your help would be very much appreciated!

Many thanks beforehand,
Nick

Hi,

there is no standard field for referencing a user object. You could implement a ValueListProvider for this probably [1].

[1] https://documentation.bloomreach.com/library/concepts/plugins/selections/configuration.html

Hello, @jasper.floor.

Thank you for confirming and offering the recommendation. It’s much appreciated.

-Nick