Labels currently can have a few config parameters and custom CSS, but they can't have their own twig files yet. I don't this this will be too hard, especially if we mirror a similar naming format to the CSS and load based on that.

See some discussion in #2894039: Labels for extra details

Comments

smccabe created an issue. See original summary.

travis-bradbury’s picture

That labels issue added theme suggestions:

+/**
+ * Implements hook_theme_suggestions_HOOK().
+ */
+function commerce_pos_label_theme_suggestions_commerce_pos_label(array $variables) {
+  $suggestions = [];
+  if (isset($variables['format'])) {
+    $suggestions[] = 'commerce_pos_label__' . $variables['format'];
+  }
+  return $suggestions;
+}

Does that do the trick, or should we do some more work for this?

smccabe’s picture

Status: Active » Needs work

Looks about fine to me, wanna roll up a patch and add a small bit to the readme as well.

smccabe’s picture

Status: Needs work » Fixed

Already exists as per #2894039: Labels

Status: Fixed » Closed (fixed)

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