定制 university-of-denver/du_policies 二次开发

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

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

university-of-denver/du_policies

最新稳定版本:10.27.1-alpha

Composer 安装命令:

composer require university-of-denver/du_policies

包简介

Package of Policy Related Features

README 文档

README

A Drupal custom module for managing and displaying University of Denver policy documents in PDF form.

Version

10.26.2 - Removes the use of taxonomy to create drop-down fields, using text lists instead. Also adds twig template usage. 10.26.0 - This version is a carbon copy of the configuration harvested from DU's Drupal 9 instance.

Description

The DU Policies module provides a complete content type, paragraph type, views, taxonomies, and user role for managing university policy documents. It enables content editors to add, update, list, and search policy documents with structured metadata.

Entity Structure

Policy Node (node.type.policy)
├── Field: Policy Document (field_policy_document) - File upload
├── Field: Keywords (field_keywords) - Text
├── Field: Policy Approver (field_policy_approver) - Taxonomy reference
│   └── Taxonomy: Policy Approver (taxonomy.vocabulary.policy_approver)
├── Field: Policy Responsible Department (field_policy_responsible_departm) - Taxonomy reference
│   └── Taxonomy: Policy Responsible Department (taxonomy.vocabulary.policy_responsible_department)
├── Field: Policy State (field_policy_state) - Taxonomy reference
│   └── Taxonomy: Policy State (taxonomy.vocabulary.policy_state)
└── Field: Updated Date (field_updated_date) - Date

Policy Paragraph (paragraphs.paragraphs_type.policy)
├── Field: Policy State (field_policy_state) - Taxonomy reference
│   └── Taxonomy: Policy State (taxonomy.vocabulary.policy_state)
└── Renders policy view block within page content

Policy View Block (views.view.policy)
├── Displays list of policy nodes
├── Exposed filters (using Better Exposed Filters module)
└── Searchable and filterable by metadata

User Role: Policy Editor (user.role.policy_editor)
└── Permissions for managing policy content

Dependencies

Drupal Module Dependencies

  • views (core)
  • better_exposed_filters (contrib)

Composer Dependencies

  • drupal/better_exposed_filters: ^6.0

Installation

  1. Ensure dependencies are installed:

    composer require drupal/better_exposed_filters
  2. Enable the module:

    drush en du_policies
  3. Clear cache:

    drush cr

Known Shortcomings

Configuration Installation

  • All configuration is added via the config/install directory. This works well for fresh installations, but update hooks need to be implemented to safely install on sites with existing roles, paragraphs, or basic page configurations.
  • The policy paragraph type must be manually added to the paragraph field on a basic page before it can be used.

Template Dependencies

  • The policy view currently renders using Twig templates from the pl_drupal theme:
    • themes/custom/pl_drupal/templates/field/field--node--field-page-content.html.twig
  • These templates and related CSS need to be moved into the du_policies module for proper encapsulation and portability.

Testing

  • No automated testing has been implemented yet.

Future Enhancements

  • Playwright testing - Add end-to-end testing coverage
  • Self-contained templates - Move Twig templates and CSS into the module
  • Update hooks - Add configuration update hooks for safe installation on existing sites
  • Automated paragraph field configuration - Automatically add policy paragraph to basic page content field

Documentation

Product History and Requirements

https://ducloudwiki.atlassian.net/wiki/spaces/DS/pages/1050542136/Policies+local

UAT Cases

https://ducloudwiki.atlassian.net/wiki/spaces/DS/pages/1203994715/UAT+-+Policies+local

License

GPL-2.0+

Maintainer

University of Denver

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2025-11-10