RWS / dxa-content-management

SDL Digital Experience Accelerator CM-side framework (.NET Template Building Blocks)
Apache License 2.0
6 stars 18 forks source link

Implement customizable binary filenames without TCM URI #56

Closed svb-wks closed 6 months ago

svb-wks commented 1 year ago

This pull request introduces enhanced flexibility for generating binary filenames, specifically addressing the need to exclude the TCM URI for certain schemas, such as PDF downloads.

The necessity for this enhancement stems from user feedback indicating that the default behavior of appending the TCM URI to the binary filenames is not practical for documents intended for download and local storage. Clean and concise filenames are particularly sought after for PDF documents.

Enhancements have been introduced in the DefaultModelBuilder and DataModelBuilder classes to facilitate this requirement. These include conditional logic that omits the TCM URI from the filename when the RenderedItem.AddBinary method is called. The method's overloads, which allow specifying a custom filename, are employed for schemas that have been configured to exclude the TCM URI.

This new functionality ensures a more user-friendly experience and grants content managers the flexibility to define clean filenames for specific schemas. The implementation is designed to be backward compatible, preserving the default behavior for all schemas that do not necessitate a deviation from the standard naming convention.

Key Changes: