定制 tserres/simple_json_view_serializer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tserres/simple_json_view_serializer

最新稳定版本:1.0.2

Composer 安装命令:

composer require tserres/simple_json_view_serializer

包简介

Add a simple JSON serializer for Drupal 10 views

README 文档

README

Description

simple_json_serializer is a style plugin for Drupal Views that serializes view results into a simplified JSON format. This serializer is tailored specifically to handle Paragraph and Taxonomy entities, offering custom output for each type.

Features

  • Paragraph Serialization: For each paragraph field in the view, the serializer provides all inner fields of the paragraph instead of just returning the paragraph's ID.
  • Taxonomy Serialization: For taxonomy fields, the serializer returns only the taxonomy term's label.

Installation

  1. Require the module using Composer:

    composer require tserres/simple_json_view_serializer
    
  2. Enable the module:

    • Via the Drupal admin interface
    • Or using Drush:
      drush en simple_json_view_serializer
      

Usage

  1. Create or edit a view.
  2. Add or modify a "REST export" display.
  3. In the format section, choose "Simple JSON Serializer".
  4. Configure your view as required.
  5. When accessing the display's REST URL, results will be serialized in the simplified JSON format defined by this plugin.

License

This module is shared under the GPLv2 license, consistent with Drupal.

Support and Contributions

For issues or suggestions, open a ticket in our issue tracking system. Pull request contributions are also appreciated.

Author

Thomas SERRES

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-10-15