Forum

Thread tagged as: Question

Image name fallback from asset-badge

When adding images to Perch via the admin I see a name that is auto generated from the filename, the code generating the name is located in PerchFieldTypes.class.php:

$s .= '<h3 class="title">';
                        if ($Asset) {
                            $s .= PerchUtil::html($Asset->title());
                        } else {
                            $s .= PerchUtil::html((isset($json['title']) ? $json['title'] : $variant['path']));
                        }
                        $s .= '</h3>';

Is this name available to the html template? I know we can output other types of info (w,h,size,path etc) but this would be very useful as a fallback for alt tags.

Is this tag visible to the html templates?

Tony Astley

Tony Astley 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

There's not currently a way to use the internal titles on your outward facing pages.