Results 1 to 6 of 6

Thread: [4.9][FEE 2.2.x-dev] First- and lastname in one select

  1. #1
    New user
    Join Date
    11-27-17.
    Posts
    3

    Default [4.9][FEE 2.2.x-dev] First- and lastname in one select

    Hi,

    I have a setup where logged in members in the frontend must be able to reference other members in a Metamodel. The issue that I have is, that a "select" attribute only allows for one column to be referenced and since firstname and lastname are separate columns I'd need to use two selects.
    That of course makes little sense since the selects are independent of each other.
    I tried making it work by creating a generated column on tl_members, but that breaks the login, because a generated column is not writable and Contao updates every value on the member object which includes the generated column.

    I'm not sure if there is a solution leveraging the DCA, I tried a few things from the dev-docs (https://docs.contao.org/dev/reference/dca/fields/) but that didn't help.

    Has anyone had a similar issue and found a solution?

  2. #2
    User zonky's Avatar
    Join Date
    11-29-11.
    Location
    Berlin
    Posts
    160

    Default

    In MM there is the attribute combined values for this - you can change it to unique values like email or username or add something like combined values to tl_member

  3. #3
    New user
    Join Date
    11-27-17.
    Posts
    3

    Default

    Quote Originally Posted by zonky View Post
    In MM there is the attribute combined values for this - you can change it to unique values like email or username or add something like combined values to tl_member
    I do know of the combined values attribute, the combined values attribute only references the table of the metamodel where the attribute is applied.
    For instance if I have a "Projects" Metamodel with the "mm_projects" table, then my combined value for "Projects" can only reference values from mm_projects not from tl_member.

    There does not seem to be a way to reference other tables in the combined value attribute?

  4. #4
    User zonky's Avatar
    Join Date
    11-29-11.
    Location
    Berlin
    Posts
    160

    Default

    Quote Originally Posted by UB3RL33T View Post
    There does not seem to be a way to reference other tables in the combined value attribute?

    that's right - combined values are only for MM and are stored in the MM table and not in tl_member ;-)

    create a new field in tl_member and fill it via save_callback... https://easysolutionsit.de/artikel/c...callbacks.html

  5. #5
    New user
    Join Date
    11-27-17.
    Posts
    3

    Default

    Quote Originally Posted by zonky View Post
    that's right - combined values are only for MM and are stored in the MM table and not in tl_member ;-)

    create a new field in tl_member and fill it via save_callback... https://easysolutionsit.de/artikel/c...callbacks.html
    That works!

    Thank you Zonky

  6. #6
    User zonky's Avatar
    Join Date
    11-29-11.
    Location
    Berlin
    Posts
    160

    Default

    und das nächste mal im DE-Forum :D

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •