public static function getTemplatePath(
        $settings,
        $elementKey,
        $onlyTemplateName = false,
        $path = null
    ): string {
        if (!$path) {
            $path = self::getFileAbsFileName(rtrim($settings['content'], '/') . '/');
        }
        $fileExtension = '.html';

        // check if an html file with underscores exist
        if (file_exists($path . CoreUtility::underscoredToUpperCamelCase($elementKey) . $fileExtension)
        ) {
            $fileName = CoreUtility::underscoredToUpperCamelCase($elementKey);
        } else {
            if (file_exists($path . ucfirst($elementKey) . $fileExtension)
            ) {
                $fileName = ucfirst($elementKey);
            } else {
                if (file_exists($path . $elementKey . $fileExtension)) {
                    $fileName = $elementKey;
                } else {
                    $fileName = CoreUtility::underscoredToUpperCamelCase($elementKey);
                }
            }
        }

        if ($onlyTemplateName) {
            return $fileName . $fileExtension;
        }
        return $path . $fileName . $fileExtension;
    }