@@ -23,10 +23,10 @@ public function __construct(PimcoreAdapter $pimcoreAdapter, bool $enableAssetPre
2323 }
2424
2525 /**
26- * @param array $result containing the nice path info. Modify it or leave it as it is. Pass it out afterwards!
27- * @param ElementInterface $source the source object
28- * @param array $targets list of nodes describing the target elements
29- * @param array $params optional parameters. may contain additional context information in the future. to be defined.
26+ * @param array $result containing the nice path info. Modify it or leave it as it is. Pass it out afterwards!
27+ * @param ElementInterface $source the source object
28+ * @param array $targets list of nodes describing the target elements
29+ * @param array $params optional parameters. may contain additional context information in the future. to be defined.
3030 *
3131 * @return array list of display names.
3232 */
@@ -109,9 +109,13 @@ private function getFormattedPath(string $className, string $pattern, ?AbstractE
109109 return '' ;
110110 }
111111
112+ $ formattedPath = $ pattern ;
113+ if ($ targetElement instanceof Asset \Image && $ this ->enableAssetPreview ) {
114+ $ formattedPath = '<img src=" ' . $ targetElement ->getFullPath () . '" style="height: 18px; margin-right: 5px;" /> ' . $ formattedPath ;
115+ }
116+
112117 $ propertyList = $ this ->getPropertyListFromPattern ($ pattern );
113118
114- $ formattedPath = $ pattern ;
115119 foreach ($ propertyList as $ property ) {
116120 $ propertyGetter = 'get ' . ucfirst (trim ($ property ));
117121 if (method_exists ($ targetElement , $ propertyGetter )) {
@@ -139,5 +143,4 @@ private function getPropertyListFromPattern(string $pattern): array
139143
140144 return !empty ($ matches ) ? $ matches [1 ] : [];
141145 }
142-
143146}
0 commit comments