| | |
| | | protected function defaultFieldTemplate(string $fieldType, string $fieldName):string |
| | | { |
| | | $data = ' data-field="'.$fieldName.'"'; |
| | | switch ($fieldName) { |
| | | case 'post_title': |
| | | return '<h3'.$data.'></h3>'; |
| | | case 'post_date': |
| | | case 'post_modified': |
| | | return '<time'.$data.'></time>'; |
| | | } |
| | | return match($fieldType) { |
| | | 'upload' => '<img'.$data.' width="300px" height="300px" sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 800px" loading="lazy" decoding="async">', |
| | | 'taxonomy' => '<ul'.$data.'><li><a><i></i></a></li></ul>', |
| | | default => '<p'.$data.'></p>', |
| | | return match ($fieldName) { |
| | | 'post_title' => '<h3' . $data . '></h3>', |
| | | 'post_date', 'post_modified' => '<time' . $data . '></time>', |
| | | default => match ($fieldType) { |
| | | 'upload' => '<img' . $data . ' width="300px" height="300px" sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 800px" loading="lazy" decoding="async">', |
| | | 'taxonomy' => '<ul' . $data . '><li><a><i></i></a></li></ul>', |
| | | default => '<p' . $data . '></p>', |
| | | }, |
| | | }; |
| | | } |
| | | /** |