<constant>

Constant value processor

Core v2.2.0

Overview

The processor creates a static, immutable text value. It's primarily used internally by the framework for static configuration values and literal text content. In user configurations, or direct text content is typically preferred.

Usage Examples

Example 1: Basic constant value

example-1.xml
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<def var="apiKey">
  <constant value="sk_live_abc123xyz"/>
</def>
</config>

Example 2: Static configuration value

example-2.xml
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<constant value="https://api.example.com/v1"/>
</config>

Example 3: Preferred alternative - use <def>

example-3.xml
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<!-- This is clearer and more common -->
<def var="baseUrl" value="https://api.example.com/v1"/>
</config>

Parameters

Related Processors