1. Fabrik 3.8 has been released. As usual, we strongly recommend that you backup your site (using Akeeba) before upgrading. Report any issues in the forums, we will answer promptly.

Multiligual ( Multilanguage ) forms alternative to Joomfish

Discussion in 'Community' started by IberoMedia, Mar 19, 2012.

  1. IberoMedia

    IberoMedia New Member

    Level: Community
    I have implemented multilingual forms w/o using any extension.

    I was reticent to install extensions to publish multilingual forms for bilingual website (joomla +1.7), and this motivated to post this alternative; I imagine there are others who want to simply use the new multilingual joomla feature

    OBJECTIVE: to have one or more forms w/ same information fields, and have the information of these fields populate the same database table

    1. you will have to create a copy of element for each language form (i.e. more work)
    2. I suggest you delete the auto-generated duplicates of these copies (read ahead)

    Create your first form: for this example form 1
    Make a note of the database table corresponding to this form (FOR THIS EXAMPLE jos_form1_table_name)

    Once you have created all of the elements for form 1, create a new form (FOR THIS EXAMPLE form 2, i.e. second language). YOU MUST CONFIGURE THIS SECOND FORM's to Record in database: jos_form1_table_name (i.e. the same databse table as form 1), AND YOU MUST CREATE a new group, different from form 1's group. Otherwise, go about the form as you would with any new form... Include a translation of the introduction, success message, or other messages in the corresponding fields.

    Begin to copy elements from form 1, with the exception of id:
    Open the first element of form 1
    Change the Label to the translation label you want (i.e. Label en-GB Name, Label es-ES Nombre)
    Change the group of this element to form 2's group
    If you have an error message / validation message in this element, translate the message to the language you want to support
    YOU MUST LEAVE THE "name" field of this element's configuration as is (i.e. records will be added to same table, same field as the original element )
    YOU MUST "Save as Copy"
    Do the same for all elements

    You will notice that duplicate elements are being AUTO-GENERATED under form 1's group. In other words, after duplicating an element, you can expect 3 elements for each database table field, with the exception of id: 2 element with labels in the alternative language (for example Nombre (group form 1), Nombre (group form 2)), and one with the original element's label ( Name (group form 1)).
    This would be the original element: Name (group form 1)
    This would be the element you SAVED AS DUPLICATE: Nombre (group form 2)
    This is the auto generated duplicate: Nombre (group form 1)

    This step is not necessary but I suggest you do it to avoid confusion:
    Go to your elements table, and filter elements by group, and choose form 1's group. Again, here you will see two element for each database field, one with the original language, and the other with the alternative language (this is the element that for some reason is auto generated). Delete the element that has the label in the alternative language, under form 1' group.

    Obviously, publish your form 1 in component menu item for language 1, and publish you form 2 in alternative component menu item for language 2 ( joomla +1.7 associate these two menu items)

    For "date time" database fields, group 1 and group 2, YOU MUST CONFIGURE under tab "List view settings" "Link to details" to No. If you do not do this, you MAY get an error, and you MAY not be able to view data through fabrik, lists, group 1, View data (I do not know why).

    Test submitting your forms in the two languages.

    Go to back end > component > fabrik > lists > group 1 > view data, and you should be able to see the information submitted through your tests (i.e the data of both forms in same lists data table)

    If you want an extra field to track the language in which the form was submitted, create another field, for example language. Create the duplicate for alternative language etc...

    Configure this element as
    Plug-in: field
    Hidden: yes

    Add javaScript in configuration:
    ACTION: load
    CODE: this.value = document.documentElement.lang;

    To include this data in the data grid (i.e. lists > group 1 > view data) configure Lists view settings:
    Show in list: yes
    Allow ordering: yes

    (remember to create this field for alternative language, and again delete auto-generated duplicate to avoid confusion...)

    I have implemented this in a bilingual website and so far everything works fine.



    P.S. I am writing this post in a hurry. It is my intention to be clear and easy to understand, but I am aware that good writing requires time.
    3 people like this.
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Thanks for taking the time to give some advise to other users.

    -- hugh
  3. rob

    rob Administrator Staff Member

    Level: Community
    1 person likes this.
  4. IberoMedia

    IberoMedia New Member

    Level: Community
  5. Barrantes

    Barrantes New Member

    Level: Community

    Hello Thanks for posting this!
    Sadly I got an erro hope you can help me.
    I followed all the steps and when I submit in form2 I get this message "SyntaxError: Unexpected token <"

    ANy idea how can i fix this ?

    Thanks in advance!
  6. IberoMedia

    IberoMedia New Member

    Level: Community

    How did you get this? Meaning, do you get the error int he front end? Do you get this error through the administrator's panel?

    Are you getting this after you create an element?

    The more detailed your information the easier it will be for me to help you.

  7. piri314

    piri314 Member

    Level: Standard
    SyntaxError: Unexpected token I


    I have the same problem in submitting form in the FrontEnd. Anyway, the form datas are saved in the DB.

    I have the forms are in 2 languages.
    Do you have an idea how to resolve this?

    Thank you
  8. piri314

    piri314 Member

    Level: Standard
    Just to tell you that the problem is only in the FrontEnd.

  9. IberoMedia

    IberoMedia New Member

    Level: Community

    I suspect the token problem has to do with validation of form data. To discard or confirm this as the source of the problem, could you try to submit your two forms again, but this time use an realistic email (i.e. example@email.com)?

    This post talks about the same problem, although not talking about the multilingual form: http://fabrikar.com/forums/showthread.php?t=24900&highlight=SyntaxError:+Unexpected+token

    Just as an update, could tell us if you are using an email field inside your form?
  10. piri314

    piri314 Member

    Level: Standard
    Hi, no changes. I tried email, redirect, receipt... nothing works in the FrontEnd.

  11. IberoMedia

    IberoMedia New Member

    Level: Community
    Could you post a url to your website?
  12. piri314

    piri314 Member

    Level: Standard
  13. piri314

    piri314 Member

    Level: Standard
    {fabrik view=form id=1}


    it seems the error is in the plugin.

    I mean, when I include {fabrik view=form id=1} in a joomla article, after fill in and submit the form, there is the SyntaxError: Unexpected token <

    if I use the form directly (link from a menu to the form) there is nos error.

    Is possible to see where is the problem?

    Thank you, kindly
  14. rob

    rob Administrator Staff Member

    Level: Community
    hi seems like your site has sef off at the moment so that link isnt going to the correct page.
    Could you re-post the non-sef version of the url please?

Share This Page