From 763d7fcdee5730699d1b469355cb5df8072ec724 Mon Sep 17 00:00:00 2001 From: Baptiste Niviere Date: Thu, 2 Sep 2021 23:38:27 -0700 Subject: [PATCH 1/8] added fields / templates --- composer-manifest.yaml | 2 +- composer.lock | 10 ++--- ...lay.node.srl_howto_instruction.default.yml | 12 +++++- ...isplay.taxonomy_term.case_type.default.yml | 29 ++++++++++---- ...lay.node.srl_howto_instruction.default.yml | 2 + ...play.node.srl_howto_instruction.teaser.yml | 2 + ...isplay.taxonomy_term.case_type.default.yml | 14 +++++++ ...o_instruction.field_case_type_override.yml | 31 +++++++++++++++ ...ield.taxonomy_term.case_type.field_url.yml | 31 +++++++++++++++ ....storage.node.field_case_type_override.yml | 19 +++++++++ .../field.storage.taxonomy_term.field_url.yml | 19 +++++++++ web/themes/custom/atrium/includes/node.inc | 39 +++++++++++++++++++ ...ode--srl-howto-instruction--full.html.twig | 4 ++ 13 files changed, 200 insertions(+), 14 deletions(-) create mode 100644 config/config-default/field.field.node.srl_howto_instruction.field_case_type_override.yml create mode 100644 config/config-default/field.field.taxonomy_term.case_type.field_url.yml create mode 100644 config/config-default/field.storage.node.field_case_type_override.yml create mode 100644 config/config-default/field.storage.taxonomy_term.field_url.yml create mode 100644 web/themes/custom/atrium/includes/node.inc diff --git a/composer-manifest.yaml b/composer-manifest.yaml index 321bb1f2..9a866442 100644 --- a/composer-manifest.yaml +++ b/composer-manifest.yaml @@ -149,7 +149,7 @@ packages: harvesthq/chosen: 1.8.7 html2text/html2text: 4.0.1 joachim-n/composer-manifest: 1.0.4 - judicialcouncil/courtyard-artifact: 0.1.167 + judicialcouncil/courtyard-artifact: 0.1.190 kub-at/php-simple-html-dom-parser: 1.9.1 laminas/laminas-diactoros: 1.8.7p2 laminas/laminas-escaper: 2.6.1 diff --git a/composer.lock b/composer.lock index 5c2f6ef9..73a91e10 100644 --- a/composer.lock +++ b/composer.lock @@ -9141,16 +9141,16 @@ }, { "name": "judicialcouncil/courtyard-artifact", - "version": "0.1.167", + "version": "0.1.190", "source": { "type": "git", "url": "https://github.com/JudicialCouncilOfCalifornia/courtyard-artifact.git", - "reference": "8467e73876bf5ce06fa3b9081d8b5f2ba4fc4319" + "reference": "adc1157bfde9a8dd20de3646c026dfa799ea7ac2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JudicialCouncilOfCalifornia/courtyard-artifact/zipball/8467e73876bf5ce06fa3b9081d8b5f2ba4fc4319", - "reference": "8467e73876bf5ce06fa3b9081d8b5f2ba4fc4319", + "url": "https://api.github.com/repos/JudicialCouncilOfCalifornia/courtyard-artifact/zipball/adc1157bfde9a8dd20de3646c026dfa799ea7ac2", + "reference": "adc1157bfde9a8dd20de3646c026dfa799ea7ac2", "shasum": "" }, "type": "drupal-library", @@ -9165,7 +9165,7 @@ } ], "description": "A build artifact of the Courtyard Pattern Lab pattern library.", - "time": "2021-08-13T16:19:02+00:00" + "time": "2021-09-02T22:39:15+00:00" }, { "name": "kub-at/php-simple-html-dom-parser", diff --git a/config/config-default/core.entity_form_display.node.srl_howto_instruction.default.yml b/config/config-default/core.entity_form_display.node.srl_howto_instruction.default.yml index f16a3508..4ba275af 100644 --- a/config/config-default/core.entity_form_display.node.srl_howto_instruction.default.yml +++ b/config/config-default/core.entity_form_display.node.srl_howto_instruction.default.yml @@ -8,6 +8,7 @@ dependencies: - field.field.node.srl_howto_instruction.field_actions - field.field.node.srl_howto_instruction.field_back_button_only - field.field.node.srl_howto_instruction.field_blocks + - field.field.node.srl_howto_instruction.field_case_type_override - field.field.node.srl_howto_instruction.field_case_types - field.field.node.srl_howto_instruction.field_column_first - field.field.node.srl_howto_instruction.field_column_second @@ -96,6 +97,7 @@ third_party_settings: - field_actions - field_parties - field_watchers + - field_case_type_override parent_name: '' weight: 14 format_type: fieldset @@ -159,6 +161,14 @@ content: third_party_settings: { } type: block_field_default region: content + field_case_type_override: + weight: 19 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content field_case_types: weight: 15 settings: { } @@ -302,7 +312,7 @@ content: type: text_textfield region: content field_watchers: - weight: 19 + weight: 18 settings: { } third_party_settings: { } type: options_select diff --git a/config/config-default/core.entity_form_display.taxonomy_term.case_type.default.yml b/config/config-default/core.entity_form_display.taxonomy_term.case_type.default.yml index dd1adeeb..5fd52ce5 100644 --- a/config/config-default/core.entity_form_display.taxonomy_term.case_type.default.yml +++ b/config/config-default/core.entity_form_display.taxonomy_term.case_type.default.yml @@ -3,8 +3,10 @@ langcode: en status: true dependencies: config: + - field.field.taxonomy_term.case_type.field_url - taxonomy.vocabulary.case_type module: + - link - path - text id: taxonomy_term.case_type.default @@ -13,23 +15,31 @@ bundle: case_type mode: default content: description: - type: text_textfield - weight: 0 + type: text_textarea + weight: 1 region: content settings: - size: 60 placeholder: '' + rows: 5 + third_party_settings: { } + field_url: + weight: 2 + settings: + placeholder_url: '' + placeholder_title: '' third_party_settings: { } + type: link_default + region: content langcode: type: language_select - weight: 2 + weight: 3 region: content settings: include_locked: true third_party_settings: { } name: type: string_textfield - weight: -5 + weight: 0 region: content settings: size: 60 @@ -37,7 +47,7 @@ content: third_party_settings: { } path: type: path - weight: 30 + weight: 5 region: content settings: { } third_party_settings: { } @@ -45,7 +55,12 @@ content: type: boolean_checkbox settings: display_label: true - weight: 100 + weight: 6 region: content third_party_settings: { } + translation: + weight: 4 + region: content + settings: { } + third_party_settings: { } hidden: { } diff --git a/config/config-default/core.entity_view_display.node.srl_howto_instruction.default.yml b/config/config-default/core.entity_view_display.node.srl_howto_instruction.default.yml index ee654ec9..e27b437a 100644 --- a/config/config-default/core.entity_view_display.node.srl_howto_instruction.default.yml +++ b/config/config-default/core.entity_view_display.node.srl_howto_instruction.default.yml @@ -7,6 +7,7 @@ dependencies: - field.field.node.srl_howto_instruction.field_actions - field.field.node.srl_howto_instruction.field_back_button_only - field.field.node.srl_howto_instruction.field_blocks + - field.field.node.srl_howto_instruction.field_case_type_override - field.field.node.srl_howto_instruction.field_case_types - field.field.node.srl_howto_instruction.field_column_first - field.field.node.srl_howto_instruction.field_column_second @@ -127,6 +128,7 @@ content: hidden: field_actions: true field_back_button_only: true + field_case_type_override: true field_case_types: true field_dark_background: true field_metatag: true diff --git a/config/config-default/core.entity_view_display.node.srl_howto_instruction.teaser.yml b/config/config-default/core.entity_view_display.node.srl_howto_instruction.teaser.yml index 6283c161..77be6a0f 100644 --- a/config/config-default/core.entity_view_display.node.srl_howto_instruction.teaser.yml +++ b/config/config-default/core.entity_view_display.node.srl_howto_instruction.teaser.yml @@ -8,6 +8,7 @@ dependencies: - field.field.node.srl_howto_instruction.field_actions - field.field.node.srl_howto_instruction.field_back_button_only - field.field.node.srl_howto_instruction.field_blocks + - field.field.node.srl_howto_instruction.field_case_type_override - field.field.node.srl_howto_instruction.field_case_types - field.field.node.srl_howto_instruction.field_column_first - field.field.node.srl_howto_instruction.field_column_second @@ -40,6 +41,7 @@ hidden: field_actions: true field_back_button_only: true field_blocks: true + field_case_type_override: true field_case_types: true field_column_first: true field_column_second: true diff --git a/config/config-default/core.entity_view_display.taxonomy_term.case_type.default.yml b/config/config-default/core.entity_view_display.taxonomy_term.case_type.default.yml index 8899dd46..d5f3c384 100644 --- a/config/config-default/core.entity_view_display.taxonomy_term.case_type.default.yml +++ b/config/config-default/core.entity_view_display.taxonomy_term.case_type.default.yml @@ -3,8 +3,10 @@ langcode: en status: true dependencies: config: + - field.field.taxonomy_term.case_type.field_url - taxonomy.vocabulary.case_type module: + - link - text id: taxonomy_term.case_type.default targetEntityType: taxonomy_term @@ -18,6 +20,18 @@ content: region: content settings: { } third_party_settings: { } + field_url: + weight: 1 + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content hidden: langcode: true search_api_excerpt: true diff --git a/config/config-default/field.field.node.srl_howto_instruction.field_case_type_override.yml b/config/config-default/field.field.node.srl_howto_instruction.field_case_type_override.yml new file mode 100644 index 00000000..3a9b1ae7 --- /dev/null +++ b/config/config-default/field.field.node.srl_howto_instruction.field_case_type_override.yml @@ -0,0 +1,31 @@ +uuid: f48cbac8-da3d-4754-833e-c5ba73f97753 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_case_type_override + - node.type.srl_howto_instruction + module: + - datalayer + - link + - tmgmt_content +third_party_settings: + datalayer: + expose: 0 + label: field_case_type_override + tmgmt_content: + excluded: false +id: node.srl_howto_instruction.field_case_type_override +field_name: field_case_type_override +entity_type: node +bundle: srl_howto_instruction +label: 'Case type Override' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/config/config-default/field.field.taxonomy_term.case_type.field_url.yml b/config/config-default/field.field.taxonomy_term.case_type.field_url.yml new file mode 100644 index 00000000..003d5d65 --- /dev/null +++ b/config/config-default/field.field.taxonomy_term.case_type.field_url.yml @@ -0,0 +1,31 @@ +uuid: 8415c092-1ea0-4703-aa73-6196dd039d2e +langcode: en +status: true +dependencies: + config: + - field.storage.taxonomy_term.field_url + - taxonomy.vocabulary.case_type + module: + - datalayer + - link + - tmgmt_content +third_party_settings: + datalayer: + expose: 0 + label: field_url + tmgmt_content: + excluded: false +id: taxonomy_term.case_type.field_url +field_name: field_url +entity_type: taxonomy_term +bundle: case_type +label: URL +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/config/config-default/field.storage.node.field_case_type_override.yml b/config/config-default/field.storage.node.field_case_type_override.yml new file mode 100644 index 00000000..718cefed --- /dev/null +++ b/config/config-default/field.storage.node.field_case_type_override.yml @@ -0,0 +1,19 @@ +uuid: 3e8827e3-968f-4b38-bd79-9d4adf482fb5 +langcode: en +status: true +dependencies: + module: + - link + - node +id: node.field_case_type_override +field_name: field_case_type_override +entity_type: node +type: link +settings: { } +module: link +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/config-default/field.storage.taxonomy_term.field_url.yml b/config/config-default/field.storage.taxonomy_term.field_url.yml new file mode 100644 index 00000000..30d87269 --- /dev/null +++ b/config/config-default/field.storage.taxonomy_term.field_url.yml @@ -0,0 +1,19 @@ +uuid: d2881a95-aa26-4bec-9995-f2543dac3f09 +langcode: en +status: true +dependencies: + module: + - link + - taxonomy +id: taxonomy_term.field_url +field_name: field_url +entity_type: taxonomy_term +type: link +settings: { } +module: link +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/web/themes/custom/atrium/includes/node.inc b/web/themes/custom/atrium/includes/node.inc new file mode 100644 index 00000000..aee77c53 --- /dev/null +++ b/web/themes/custom/atrium/includes/node.inc @@ -0,0 +1,39 @@ +getType()) { + case "srl_howto_instruction": + if (!$node->get('field_case_type_override')->isEmpty()) { + $case_type_override = $node->get('field_case_type_override'); + $variables['case_index']['url'] = $case_type_override[0]->get('uri')->getValue(); + $variables['case_index']['label'] = t('Index: All ') . $case_type_override[0]->get('title')->getValue() . t(' Pages'); + } else { + $terms = $node->get('field_case_types')->referencedEntities(); + if(count($terms) == 1){ + if (!$terms[0]->get('field_url')->isEmpty()) { + $term_custom_uri = $terms[0]->get('field_url')->getValue(); + $variables['case_index']['url'] = $term_custom_uri[0]['uri']; + } else { + $id = $terms[0]->id(); + $aliasManager = \Drupal::service('path.alias_manager'); + $variables['case_index']['url'] = $aliasManager->getAliasByPath('/taxonomy/term/'.$id); + } + $variables['case_index']['label'] = t('Index: All ') . $terms[0]->label() . t(' Pages'); + } + } + break; + } +} diff --git a/web/themes/custom/atrium/templates/node/node--srl-howto-instruction--full.html.twig b/web/themes/custom/atrium/templates/node/node--srl-howto-instruction--full.html.twig index c8cd60d0..ba2d775a 100644 --- a/web/themes/custom/atrium/templates/node/node--srl-howto-instruction--full.html.twig +++ b/web/themes/custom/atrium/templates/node/node--srl-howto-instruction--full.html.twig @@ -28,6 +28,10 @@ body: content.field_column_first|render ? content.field_column_first : '', column_content_right: content.field_column_second|render ? content.field_column_second : '', banner_image: node.field_image.0 ? file_url(node.field_image.0.entity.field_media_image.entity.uri.value), + case_type: { + url: case_index.url, + label: case_index.label + } } } %} From 87267a867422ac270d0f89871a53c4dd3ea951ab Mon Sep 17 00:00:00 2001 From: Baptiste Niviere Date: Fri, 3 Sep 2021 19:18:16 -0700 Subject: [PATCH 2/8] table in text format --- config/config-default/editor.editor.basic_html.yml | 1 + config/config-default/filter.format.basic_html.yml | 2 +- config/config-default/filter.format.simple_html.yml | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/config/config-default/editor.editor.basic_html.yml b/config/config-default/editor.editor.basic_html.yml index fd8799c3..c108e38c 100644 --- a/config/config-default/editor.editor.basic_html.yml +++ b/config/config-default/editor.editor.basic_html.yml @@ -28,6 +28,7 @@ settings: - Outdent - Indent - HorizontalRule + - Table - name: Linking items: diff --git a/config/config-default/filter.format.basic_html.yml b/config/config-default/filter.format.basic_html.yml index 7d841623..3730d678 100644 --- a/config/config-default/filter.format.basic_html.yml +++ b/config/config-default/filter.format.basic_html.yml @@ -23,7 +23,7 @@ filters: status: true weight: -10 settings: - allowed_html: '