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

Design / Function question

Discussion in 'Community' started by wuschel_lux, Jul 10, 2019.

  1. wuschel_lux

    wuschel_lux Member

    Level: Community
    Hi all,

    I need your experts advice for following case.

    I want to create a form for parents to register on a site. A Joomla user is also be generated with the juser form plugin and stored. Works fine.
    In this register form parents are storing data like address, contact data, .. and also they can add up to 3 kids (first name, last name, birthday).

    On a second form they can register to a course, I want to have parents data already available and a dropdown with the children inside, when logged in.

    I tried now to get the info in the form but I am stuck to get the info. I managed to get the joomla ID and the user's name with the code in a calc field:
    But to get the ID from the fabrik table with the parent's data in, I failed as I can not do a SQL query on a calc element from a calc element.

    Is there a more elegant or simple way to get the some data of form 1 into form 2? Or have I a complete design problem with this idea.

    Thanks for your contribution and help.
    BR
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    Have a look at the autofill form plugin.
    You can do the complete calc in your 2nd calc element.
    If it's only for display you can use a display element (with eval) or maybe a dbjoin with "or concat label".
     
  3. wuschel_lux

    wuschel_lux Member

    Level: Community
    Thanks a lot! Sometimes it could be easy. I will also have a look on the autofill plugin.
     
  4. wuschel_lux

    wuschel_lux Member

    Level: Community
    Hi again,
    relate on the same topic.

    with the database join element I manage to get the first_name of each children in the dropdown, coming from a repeat group. No I try to only showing the kid that belongs to the corresponding parent:
    Code (Text):
    WHERE {thistable}.parent_id = '2'
    works fine, but need to do this flexible adapting to the logged in user, trying following:
    Code (Text):
    WHERE {thistable}.parent_id = '{fkm_register_course___user_id_raw}'
    but I am not sure that he gets the value from the calc field.

    Is there a another way to limit the output of the databasejoin?
    Thanks for your support.
     
  5. troester

    troester Well-Known Member Staff Member

    Level: Community
    You don't need to calc the user_id of the logged in user, there are placeholders {$my->id}, {$my->name} etc.
     
  6. wuschel_lux

    wuschel_lux Member

    Level: Community
    yes and no.

    The databasejoin is looking on the repeat table where the parent_id is not the joomla id of the user but from the first table where the user creates his account. So it's not clear for me where to take the value.

    e.g. The user creates an account via form 1 and has a form1.id = 5 but get's a joomla.user.id =823. The form1.id is used for the intermediate table for the repeats. Hope I explained it somehow clear?

    Thanks
     
  7. troester

    troester Well-Known Member Staff Member

    Level: Community
    something like
    WHERE {thistable}.parent_id = (SELECT f.id from first_table f where f.user_id = {$my->id})
    (Assuming every user has exactly one entry in first_table)
     
  8. wuschel_lux

    wuschel_lux Member

    Level: Community
    Many, many thanks for your great help pushing me in a good direction. It works now as expected.

    Only one thing is a styling problem with databasejoin left on my template I did not get yet solved.
    BR
     
  9. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    We can't really help with individual site template styling issues like that. The uikit template is applying those border styles, so it's a case of figuring out the selector you need to override their styling.

    Do you know how to use Chrome's debug tools, to inspect your page and find what selectors are being applied by what CSS files?

    -- hugh
     
  10. wuschel_lux

    wuschel_lux Member

    Level: Community
    Thanks a lot, yes I know it, using the inspect tool of safari and also identified what to eliminate (size="1"), but no glue how to achieve it. I will try to figure it out with the template guy.
    Thanks.
     

Share This Page