Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-3108

Let site plugins easily create "only title" and "prerendered" blocks

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 3.7.0
    • Fix Version/s: 3.7.1
    • Component/s: Blocks, Site add-ons
    • Labels:
    • Testing Instructions:
      Hide

      This issue only needs to be tested in 1 device.

      Please notice that, since the block to test will be added to the dashboard, it's possible that you need to restart the app twice instead of just once during the tests (it depends on how long the WS to get the site plugins takes to respond).

      1. Install the plugin in a Moodle site.
      2. Login as a student in web and go to dashboard.
      3. Click "Customise this page" and then "Add a block".
      4. Add a new block of type "Test block".
      5. Edit the block and put a title and some content in it (it's a copy of the HTML block).
      6. Now login in the app with that student and go to the dashboard. Check that you see a "box" with the title "Test block" and the content "This is a block test!".
      7. Edit the file blocks/testblock/db/mobile.php. Inside the 'displaydata' property, add a new field: 'type' => 'title'.
      8. Purge the Moodle caches.
      9. Restart the app and go back to the dashboard. Check that now you only see "Test block" and you don't see the content saying it's a test.
      10. Click the title "Test block". Check that a new page is opened and you can see the "box" with the title and the content in that page.
      11. Edit the file blocks/testblock/db/mobile.php again and now set the type to 'prerendered'.
      12. Purge the Moodle caches.
      13. Restart the app and go back to the dashboard. Check that now you see the title "Test block" and the contents have the content you put in the block in the step 5.
      Show
      This issue only needs to be tested in 1 device. Please notice that, since the block to test will be added to the dashboard, it's possible that you need to restart the app twice instead of just once during the tests (it depends on how long the WS to get the site plugins takes to respond). Install the plugin in a Moodle site. Login as a student in web and go to dashboard. Click "Customise this page" and then "Add a block". Add a new block of type "Test block". Edit the block and put a title and some content in it (it's a copy of the HTML block). Now login in the app with that student and go to the dashboard. Check that you see a "box" with the title "Test block" and the content "This is a block test!". Edit the file blocks/testblock/db/mobile.php . Inside the 'displaydata' property, add a new field: 'type' => 'title'. Purge the Moodle caches. Restart the app and go back to the dashboard. Check that now you only see "Test block" and you don't see the content saying it's a test. Click the title "Test block". Check that a new page is opened and you can see the "box" with the title and the content in that page. Edit the file blocks/testblock/db/mobile.php  again and now set the type to 'prerendered'. Purge the Moodle caches. Restart the app and go back to the dashboard. Check that now you see the title "Test block" and the contents have the content you put in the block in the step 5.
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Sprint:
      Moodle App 3.7.1

      Description

      We should let site plugins easily create "only title" blocks, that will also allow us to decrease WS calls. This way the block can be displayed without calling any WS, it will only be called when the user clicks the block.

        Attachments

          Activity

            People

            Assignee:
            dpalou Dani Palou
            Reporter:
            dpalou Dani Palou
            Peer reviewer:
            Pau Ferrer
            Integrator:
            Juan Leyva
            Tester:
            Pau Ferrer
            Participants:
            Component watchers:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              30/Aug/19