-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration
The following options are available:
-
Field output: Normal or Raw This determines if each object in the view is displayed as normally rendered by Drupal, or as the raw result object. Raw is useful if you don't want any Drupal formatting applied to the view result, for example, if you have a field with a date and you just want the timestamp value from the database. Note that both a field's label and content are rendered as raw so XML element or attribute labels will have the internal field name - for example instead of 'Body' a raw field will have the label 'node_revisions_body'.
-
Plaintext output Selecting this means that all HTML markup will be stripped from the view result. This is useful, for example, if you are generating an XML document from nodes and you just want the plain text content of a node without markup tags mixing with the other XML elements. (Note that you can also escape XML content using CDATA sections, see below.)
-
Content-Type This determine the Content-Type header sent in a page display of a view. This header is necessary for most clients consuming data from the view. You can use the default Content-Type for the particular plugin or choose from alternate types.
-
Use Views API mode By default the plugins stop Drupal from doing any additional processing when a view is rendered, allowing the content to be output without any additional Drupal markup. However, if you are calling a view programatically then this will hlar your code prematurely. The solution is to use the Use Views API mode option if you are going to call the view from code. This option causes the plugin to not terminate Drupal execution.
The views_json plugin has the following options:
-
Root object name This specifies the name of the top-level object in the JSON object. The default is the name of the view base table (nodes, users, etc.)
-
JSON data format This specifies the format of the JSON output - either simple, single simple object with key value properties, plain- vanilla JSON, or the JSON format compatible with the Simile/Exhibit application.
-
"Single Simple Object with key value properties" JSON data format It is useful when you want to return a single object just for one row, { title: "Example", status: "published" } instead of {[ ... ]}.
This format available when you set "Items per page" views pager setting, that available on all pager formats except "Display all items". Also if you try to return more results than one, it will return only first row.
This format ignores such options as: "Root object name" & "Top-level child object".