Skip to main content
Skip table of contents

Display Pattern: Replace Extension and Underlines from File Name

Summary

Add original filename and replace extension and underlines for images.

CODE
{{data.fileMetadata.fileName 
  | replace: data.imageMetadata.fileExtension , "" 
  | replace: "_" , " " 
  | replace: "-" , " "
}}

Access File Name

  • You find the filename on File Metadata (File Types > File) and all other file types.

  • You must update all file types individually.

Use Case

By using the original filename a field can already show a value, so the customer can only update the text. The filename may contain underlines which will be considered when searching and led to wrong search results.

To avoid wrong search results the underlines shall be replaced. Use any values from a field (accessed via fieldpath) and replace underlines and dashes with spaces and file extension with nothing (remove file extension).  

JSON
{{data.fileMetadata.fileName 
  | replace: data.imageMetadata.fileExtension , "" 
  | replace: "_" , " " 
  | replace: "-" , " "
}}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.