![]() * 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. Pretty basic, let's go! var wordgame_answer = '' // Holds the current answer. i18n disabled, still no translate tab on a node page and no 'Multilingual support' tab on a content type edit page. 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. 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: You don't have to credit me unless you prefer to. Using my translations in quotebots, fanworks, story analysis, etc. card quotes, skill names, etc.) in the Enstars Wiki. This means you're free to copy the URL of a translation and link it on a page. To do this, set the 'front' variable in settings.js to the 'play' page. Linking my translations in directories, etc. 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. 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. 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. Firstly, you need to enable all the 4 core modules in your drupal site. 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 |