Inside Info: File alias token and extra field

Last updated on
25 April 2023

As discussed at length, one of the most important features of this module is that it always serves the hpt file from an alias that meets cms.gov standards: [ein]_[hospitalname]_standardcharges.[json|xml|csv]. This important string is available as an extra field and as a token provided by the module.

File alias extra field

The "File alias" extra field is available to be placed in field_ui. This extra field can be rendered as plain text, a link, or a direct download link. Since extra fields do not use field formatters, the configuration is available as part of the global module configuration.

As an example use case, let's say we'd like to show a list of all hpt entities but we just to render them as linked file aliases. This is easy!

We can configure the teaser view mode to render the File alias extra field.

Then we create a View of teasers just as described in How To: Show a list of HPT entities. And we're done!

File alias token

This module provides a hpt:file_alias token that gets replaced with the standardized file alias. It gives some extra info in the token browser.

This is useful for configuring Pathauto if you absolutely must provide a customized alias. But life is probably simpler if you let the Hospital Price Transparency module manage its own aliases and do not leverage Pathauto for hpt entities.

Help improve this page

Page status: No known problems

You can: