Skip to main content

XpmLiquidMatrixDrop.liquidMethodMissing() method

Resolves a missing matrix parameter and performs nested substitutions.

Signature

liquidMethodMissing(key: string, context: Context): Promise<any>;

Parameters

Parameter

Type

Description

key

string

The matrix parameter name requested by the template.

context

Context

The Liquid rendering context.

Returns

Promise<any>

The resolved matrix parameter value.

Exceptions

XpmInputError If the matrix parameter is not defined.

Remarks

Called by the Liquid engine when a matrix parameter is accessed that doesn't exist as a regular method. This implements the Drop pattern for dynamic matrix parameter resolution.

Resolution process:

  1. Validate the parameter exists, throw XpmInputError if not.
  2. Retrieve the parameter value (string, array, or object).
  3. If object, return as-is for Liquid to access nested properties.
  4. If array, join elements into a single string for processing.
  5. If the value contains Liquid syntax, recursively render it with the current context to resolve nested references.
  6. Return the final resolved value.

This mirrors the behavior of XpmLiquidPropertiesDrop but operates on matrix parameters instead of properties. Matrix values can reference other substitution variables, enabling complex template expansions.


Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.