Problem/Motivation

Currently you need a hook to specify labels for each level of depth.

Proposed resolution

Make this configurable.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 2950251-2.patch5.99 KBsam152

Comments

Sam152 created an issue. See original summary.

sam152’s picture

Status: Active » Needs review
StatusFileSize
new5.99 KB

Here is an initial patch for review.

acbramley’s picture

Status: Needs review » Needs work
  1. +++ b/src/Plugin/WebformElement/ShsTermSelect.php
    @@ -20,6 +21,64 @@ use Drupal\webform\Plugin\WebformElement\WebformTermSelect;
    +            '#markup' => sprintf('%s: ', $element['#depth_labels'][$delta]) ?? '',
    

    Embarrassingly, I hadn't even seen this operator used before.
    One quick google later...
    In the essence of PHP compatibility and given that we only have 2 options should we just use a ternary instead?

    Also would this not produce a notice if there were less labels than hierarchy configured?

  2. +++ b/src/Plugin/WebformElement/ShsTermSelect.php
    @@ -80,8 +140,69 @@ class ShsTermSelect extends WebformTermSelect {
    +      '#title' => t('Depths Labels'),
    

    Nit: Depth labels

  • hugronaphor committed 8ebe8fe on 8.x-1.x authored by Sam152
    Issue #2950251 by Sam152, acbramley: Allow users to specify a label for...
hugronaphor’s picture

Title: Allow users to specify a label for each level of depth and optionally show the full hierarchy of terms in HTML emails » Allow users to specify a label for each level of depth and optionally show the full hierarchy of terms in HTML links

@acbramley was right + there was an issue with the ajax form which I've addressed already.

Thanks

hugronaphor’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.