diff --git a/modules/localgov_media/config/optional/linkit.linkit_profile.default.yml b/modules/localgov_media/config/optional/linkit.linkit_profile.default.yml index bf07d35..62f7471 100644 --- a/modules/localgov_media/config/optional/linkit.linkit_profile.default.yml +++ b/modules/localgov_media/config/optional/linkit.linkit_profile.default.yml @@ -2,6 +2,7 @@ langcode: en status: true dependencies: module: + - localgov_core - node - paragraphs_library label: Default @@ -17,7 +18,7 @@ matchers: group_by_bundle: true substitution_type: canonical limit: 100 - include_unpublished: false + include_unpublished: true weight: -10 c3257417-fce9-4307-8251-58672edf88be: id: email diff --git a/src/Plugin/Linkit/Matcher/EntityMatcher.php b/src/Plugin/Linkit/Matcher/EntityMatcher.php new file mode 100644 index 0000000..d3db8f4 --- /dev/null +++ b/src/Plugin/Linkit/Matcher/EntityMatcher.php @@ -0,0 +1,34 @@ +label()); + + // Prepend "Unpublished: " for unpublished entities. + if (method_exists($entity, 'isPublished') && !$entity->isPublished()) { + $label = 'Unpublished: ' . $label; + } + + return $label; + } + +} diff --git a/src/Plugin/Linkit/Matcher/NodeMatcher.php b/src/Plugin/Linkit/Matcher/NodeMatcher.php new file mode 100644 index 0000000..4b1930d --- /dev/null +++ b/src/Plugin/Linkit/Matcher/NodeMatcher.php @@ -0,0 +1,35 @@ +label()); + + // Prepend "Unpublished: " for unpublished nodes. + if (method_exists($entity, 'isPublished') && !$entity->isPublished()) { + $label = 'Unpublished: ' . $label; + } + + return $label; + } + +}