Skip to content

Asset Naming

Filename Structure

An asset's filename is composed of the following components (parts in parentheses are conditional or optional):

[name](-[language_code])(.[flag_values_seperated_by_dot])[file_extension]

  • The [name] component describes the content that the asset applies to.
  • The [language_code] component indicates the language version of the content that the asset applies to. A missing language code means the asset applies to all languages on the website.
  • The [flag_values_seperated_by_dot] component contains flag values separated by dots.
  • The [file_extension] component informs Enqueueror about the type of the asset and how it should be processed.

Content Targeting

The table below contains a list of patterns pertaining to the [name] component of an asset's filename. These patterns encompass all content targeting scenarios that Enqueueror supports:

ScenarioName PatternExample
Every kind of contentglobalglobal
Content of any post typetypetype
Specific content by IDtype-id-[id]type-id-1
Specific content by slugtype-slug-[slug]type-slug-home
Content of a specific post typetype-[post_type]type-post
Content of a specific post type identified by post IDtype-[post_type]-id-[id]type-post-id-1
Content of a specific post type identified by post slugtype-[post_type]-slug-[slug]type-post-id-post1
Archive of any taxonomytermterm
Specific term archive identified by term IDterm-id-[term_id]term-id-1
Specific term archive identified by term slugterm-slug-[slug]term-slug-category1
Any term archive of a specific taxonomytax-[taxonomy]tax-category
Specific term archive of a specific taxonomy identified by taxonomy name and term IDtax-[taxonomy]-term-id-[id]tax-category-term-id-1
Specific term archive of a specific taxonomy identified by taxonomy name and term slugtax-[taxonomy]-term-slug-[slug]tax-category-term-slug-category1
Archive of an arbitrary useruseruser
Archive of a specific user identified by user IDuser-id-[user_id]user-id-1
Every type of archivearchivearchive
Date archivearchive-datearchive-date
Archive of a specific post typearchive-type-[post_type]archive-type-post
Search pagesearchsearch
Not found pagenot-foundnot-found

Flags

An asset's filename may include one or more special keywords, referred to as "flag values", which dictate how Enqueueror delivers the asset's code in the context of the HTML being served to the browser.

The flag component of the filename pertains to the [flag_values_separated_by_dot] component.

For more information please refer to the Asset Flags section of the Guide.

Multilingual Support

Enqueueror provides support for multilingual websites that use WPML or Polylang, by conditionally delivering assets based on the language of the content.

The language specifier for an asset corresponds to the [language_code] component of an asset's filename.

Examples:

ScenarioLanguage CodeFilename
Global asset - All languagesNoneglobal.css
Global asset - English onlyenglobal-en.css
Global asset - Greek onlyelglobal-el.css
Post with ID 1 - All languagesNonetype-post-id-1.css
Post with ID 1 - English onlyentype-post-id-1-en.css
Post with ID 1 - Greek onlyeltype-post-id-1-el.css