1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

How to display an extra element from the joined table?

Discussion in 'Community' started by bontemuis, May 16, 2020.

  1. bontemuis

    bontemuis Member

    Level: Community
    I have two tables with a 1:1 relationship: Profile* and AdditionalInfo**. I made a LEFT join from Profile (id) to AdditionalInfo (prf_id).
    The prf_id element is a databasejoin which displays Name from the Profile. In the 'Add option in front end' tab I set 'Link to the joined record' to Yes to (hyper)link Name to Profile. The AdditionalInfo List looks like: Name (join), Field1 etc.

    Question 1: what do I need to do to also display Company in the AdditionalInfo List? I guess I don't need to add another databasejoin, do I?
    Question 2: if I do a CSV export, the Name field shows either the 'id' or a url link to Profile. How do I get the actual Name value?

    *Profile: id, Name, Company etc.
    **AdditionalInfo: id, prf_id, Field1, Field2 etc. I want to change this to: id, prf_id, Company form Profile, Field1, Field2
     
  2. bontemuis

    bontemuis Member

    Level: Community
    I'm not yet very experienced with Fabrik obviously :), but I could really use some help on these two matters. Anyone?
     
  3. troester

    troester Well-Known Member Staff Member

    Level: Community
    Why don't you use your joined "Profile" list to display all infos?

    But anyway:
    In a dbjoin element you can use "or concat label" to display multiple elements of the parent list, something like (Literally {thistable})
    {thistable}.Company,': ',{thistable}.name
    or (in Advanced) you can define a "Description field"
    http://fabrikar.com/forums/index.php?wiki/database-join-element/
     
  4. bontemuis

    bontemuis Member

    Level: Community
    Thanks Troester,

    I tried option 2 first and that worked. It also answered my second question, about the CSV export. So now I would like to understand option 1.
    If you say 'joined' Profile List, I assume you just mean the Profile List with the 6 different (1 to 1) Joins; because I don't have any other Profile list.
    So how exactly can I change something to display e.g. two fields of Profile and all the other fields of the joined table? To me it seems this works just the other way around?
     
  5. bontemuis

    bontemuis Member

    Level: Community
    Hi Troester,

    Could you please shine your light on "Why don't you use your joined "Profile" list to display all infos?".
    So I need to have:
    Joined table 1: id, prf_id (=name of Profile), Company from Profile, Field1, Field2 etc
    Joined table 2: id, prf_id (=name of Profile), Company from Profile, Field1, Field2 etc
    Joined table 3: id, prf_id (=name of Profile), Company from Profile, Field1, Field2 etc
    Etc.

    Thanks in advance.
     

Share This Page