diff --git a/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module b/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module index a5b49f7c..66ba6d9c 100644 --- a/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module +++ b/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module @@ -142,7 +142,8 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList { $out = ''; $repeaterTitle = $this->field ? $this->field->get('repeaterTitle') : ''; - + $colorPrefix = "\rCOLOR\r"; + if($page->id && $repeaterTitle) { // custom repeater titles specified $hasCnt = stripos($repeaterTitle, '#n') !== false; @@ -153,6 +154,10 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList { $repeaterTitle = str_replace("#n", "#$cnt", $repeaterTitle); } + if(strpos($repeaterTitle, '#') !== false) { + $repeaterTitle = preg_replace('/#([a-f\d]{3,})/i', "$colorPrefix$1", $out); + } + if(strpos($repeaterTitle, '{') !== false) { // formatted {label} $out = $page->getText($repeaterTitle, true); @@ -198,6 +203,13 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList { $pos = strrpos($out, ' '); if($pos > ($maxlen / 2)) $out = substr($out, 0, $pos); } + + if(strpos($out, '#') !== false) { + $sp = html_entity_decode('​', 0, 'UTF-8'); + $out = str_replace('#', "#$sp", $out); + } + + $out = str_replace($colorPrefix, '#', $out); return $out; }