You are here

README.txt in Views Json Source 1.x

Same filename and directory in other branches
  1. 8 README.txt
CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Requirements
 * Installation
 * Configuration
 * How it works
 * Maintainers


INTRODUCTION
------------

Views Json Source is an extension of views module to work with external JSON data.
Any JSON API can be configured, to render the data from the JSON through views.

 * For a full description of the module, visit the project page:
   https://www.drupal.org/project/views_json_source

 * To submit bug reports and feature suggestions, or to track changes:
   https://www.drupal.org/project/issues/search/views_json_source


REQUIREMENTS
------------

No special requirements.


INSTALLATION
------------

 * Install as you would normally install a contributed Drupal module.
   See: https://www.drupal.org/node/895232 for further information.


CONFIGURATION
-------------

No configuration is needed.


HOW IT WORKS
------------

When creating a view choose "Json" on "Show" field.
Then when editing the view, In "Advanced" section, click "Settings" on "Query settings",
choose the source of the Json data, define the row apath and you're done.
Now just add one or more fields and set the key value of the field you want to show.
Add any filters or sort criteria as required.
Make use of Contextual filters as required.

Example #1:
A file called nodes.json that is hosted on www.example.com with the
following structure:
{
  "nodes": [
    {
      "nid": 1,
      "title": "Views JSON QUery",
      "description": "A quite handy module."
    },
    {
      "nid": 2,
      "title": "Views XML Backend",
      "description", "Luke, I'm your father."
    }
  ]
}

Query settings:
  Json File: http://www.example.com/nodes.json
  Row Apath: nodes


Example #2:
A file called sample.json that is hosted on www.example.com with the
following structure:
{
  "nodes": {
    "contents": [
      {
        "id": 1,
        "title": "Sample One",
        "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
      },
      {
        "id": 2,
        "title": "Sample Two",
        "description", "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
      }
    ]
  },
  "taxonomy": {
    "contents": [
      {
        "id": 1,
        "title": "Category One",
        "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
      },
      {
        "id": 2,
        "title": "Category Two",
        "description", "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
      }
    ]
  }
}

Query settings:
  Json File: http://www.example.com/sample.json
  Row Apath: %/contents
Contextual Filter:
  Add a contextual filter of type "Apath Replacement".
Sample views url: http://<domain>/<views url>/nodes or http://<domain>/<views url>/taxonomy


MAINTAINERS
-----------

Current maintainers:
 * Pradeep Venugopal (venugopp) - https://www.drupal.org/u/venugopp

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Requirements
  5. * Installation
  6. * Configuration
  7. * How it works
  8. * Maintainers
  9. INTRODUCTION
  10. ------------
  11. Views Json Source is an extension of views module to work with external JSON data.
  12. Any JSON API can be configured, to render the data from the JSON through views.
  13. * For a full description of the module, visit the project page:
  14. https://www.drupal.org/project/views_json_source
  15. * To submit bug reports and feature suggestions, or to track changes:
  16. https://www.drupal.org/project/issues/search/views_json_source
  17. REQUIREMENTS
  18. ------------
  19. No special requirements.
  20. INSTALLATION
  21. ------------
  22. * Install as you would normally install a contributed Drupal module.
  23. See: https://www.drupal.org/node/895232 for further information.
  24. CONFIGURATION
  25. -------------
  26. No configuration is needed.
  27. HOW IT WORKS
  28. ------------
  29. When creating a view choose "Json" on "Show" field.
  30. Then when editing the view, In "Advanced" section, click "Settings" on "Query settings",
  31. choose the source of the Json data, define the row apath and you're done.
  32. Now just add one or more fields and set the key value of the field you want to show.
  33. Add any filters or sort criteria as required.
  34. Make use of Contextual filters as required.
  35. Example #1:
  36. A file called nodes.json that is hosted on www.example.com with the
  37. following structure:
  38. {
  39. "nodes": [
  40. {
  41. "nid": 1,
  42. "title": "Views JSON QUery",
  43. "description": "A quite handy module."
  44. },
  45. {
  46. "nid": 2,
  47. "title": "Views XML Backend",
  48. "description", "Luke, I'm your father."
  49. }
  50. ]
  51. }
  52. Query settings:
  53. Json File: http://www.example.com/nodes.json
  54. Row Apath: nodes
  55. Example #2:
  56. A file called sample.json that is hosted on www.example.com with the
  57. following structure:
  58. {
  59. "nodes": {
  60. "contents": [
  61. {
  62. "id": 1,
  63. "title": "Sample One",
  64. "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
  65. },
  66. {
  67. "id": 2,
  68. "title": "Sample Two",
  69. "description", "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
  70. }
  71. ]
  72. },
  73. "taxonomy": {
  74. "contents": [
  75. {
  76. "id": 1,
  77. "title": "Category One",
  78. "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
  79. },
  80. {
  81. "id": 2,
  82. "title": "Category Two",
  83. "description", "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
  84. }
  85. ]
  86. }
  87. }
  88. Query settings:
  89. Json File: http://www.example.com/sample.json
  90. Row Apath: %/contents
  91. Contextual Filter:
  92. Add a contextual filter of type "Apath Replacement".
  93. Sample views url: http:////nodes or http:////taxonomy
  94. MAINTAINERS
  95. -----------
  96. Current maintainers:
  97. * Pradeep Venugopal (venugopp) - https://www.drupal.org/u/venugopp