* The jQueryMobile pageshow call back function for the play page. Markup:drupalgap_get_form('wordgame_word_form') * The page call back function for the play page. All the drupal translation modules can be configured at path /admin/config/regional Drupal Language Module This Drupal 8 language module is one of the core modules located at core/modules/language. Pretty basic, let's go! var wordgame_answer = '' // Holds the current answer. Firstly, you need to enable all the 4 core modules in your drupal site. We'll provide buttons to let the player submit their answer, see the answer (if they don't know the answer), and to retrieve another word. I am trying to add translation for contact form for a multi language site. Once we have the random word JSON object, we will display the translated word and provide a text field for the player to enter the English translation of the word. Our game will be pretty simple, it will grab the JSON for a random word (and its translation) from our Drupal website. Here is what our page will look like when our App loads: To do this, set the 'front' variable in settings.js to the 'play' page. Now if we set our App's front page to our newly created page, we'll see the new page. Now when we preview the results of our view, we should see something like this: On the next screen, change the label to 'title_translated', then click the 'Apply (all displays)' button.Ĭlick the 'Settings' link next to 'JSON data document' under 'Format', uncheck the 'Views API mode' checkbox and then click the 'Apply (all displays)' button. To do this, click the 'Add' button next to 'Fields', type 'title' into the 'Search' text box, select 'Content: Title - Appears in node:article', then click the 'Apply (all displays)' button. On the next screen, change the label from 'Nid' to 'nid', then click the 'Apply (all displays)' button.Īdd the translated title field to your view. The translation interface is integrated as tabs on each configuration screen and there is an overview of all translatable configurations available too, for. To do this, click the 'Add' button next to 'Fields', type 'nid' into the 'Search' text box, select 'Content: Nid' when it shows up in the search results list, then click the 'Apply (all displays)' button. To do this, select 'Global' from the 'Filter' drop down menu, then check the box next to 'Global: Random' and then click the 'Apply (all displays)' button.Īdd a Node ID field to your view. Show 'Content' of type 'Article' sorted by 'Unsorted'Īdd some 'Sort Criteria' to return a randomly selected word (article), even though we only have 1 right now.On the 'Add new view' form, enter values like this: Our mobile application will need to be able to consume JSON data from our Drupal site. Create a View to Return a Random Word (Article) Review step #5 to see the language detection and selection settings that make the above translated link possible.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |