<v:text>
Outputs the text associated with a Vae text structure, text area structure, or rich text area structure.
Required Attributes
-
path
- the path to the Vae text structure you wish to output. Uses VaeQL syntax.OR:
-
param
- name of a request parameter. If set, will output the value stored in that request parameter. The value will be HTML sanitized.OR:
-
placeholder
- renders a placeholder value that will be filled in with the real value from an eCommerce order once it is available to the system. This attribute is useful for building E-Mail templates that are associated with eCommerce orders.Valid values for the placeholder attribute are:
id
, which will insert the order ID number,notes
which will be replaced with order notes,password
which will be replaced with the new password assigned to a user in a forgot password email,shipment_company
, which will insert the shipping company,shipment_date
, which will insert the date of shipment, andshipment_tracking_number
, which will insert the shipping tracking number,OR:
-
text
- text that will be rendered directly.
Optional Attributes
-
after
- text that will be added after the rendered text. -
asset_height
- if this is a rich text field with embedded assets such as video or images, setting this attribute will scale these assets to be no bigger than this many pixels high. If you provideasset_height
, you must also provideasset_width
. -
$asset_quality
[(optional)] - set to an integer from 1 to 100 to define the JPG quality of embedded image assets. If an embedded image asset is not a JPEG, this value is ignored. -
asset_width
- similar toasset_height
, but for width. If you provideasset_width
, you must also provideasset_height
. -
audio_player_vars
- string of ampersand-delimited options to customize the audio player that may be displayed if a Rich Text structure contains audio files. The available options are listed on the audio player website. -
before
- text that will be prepended to the rendered text. -
color
- text color to be used when an image is generated from the text. -
font
- if specified, the font will be rendered into an image using the font you specified. The.ttf
file for this font must be in the root directory of your website. -
font-size
- font size to be used when an image is generated from the text. -
kerning
- kerning (inter-character spacing) in pixels to be used when an image is generated from the text. -
links_to_new_window
- if set toexternal
, all external links will be rendered to open in a new window when clicked. If set to anything else, all links (internal and external) will be rendered to open in a new window when clicked. -
max-width
- maximum width (in pixels) of the image to be generated when an image is generated from the text. -
maxlength
- maximum length of the string to be displayed (in number of characters). If the text is longer than this, it will be clipped and an elipses (…
) will be inserted. -
nohtml
- if set totrue
, all HTML tags will be from the output, replacing<p>
and<br />
tags with newlines. -
number_format
- if present, the text string will be formatted with grouped thousands. The value of this attribute will control the number of displayed decimal places. For examplenumber_format="2"
would cause the string10000
to render as10,000.00
. If thebefore
orafter
attributes are also present, then those values are prepended or appended to the number prior to formatting. -
padding
- padding (in pixels) to be used when an image is generated from the text. -
section
- If the structure specified in the path attribute is a Rich Text Area, specify a number here to only render a certain section of the content. Content in a Rich Text Area may be divided by creating dividers in the editor widget in the backstage. The content before the first divider is considered section0
, after the first divider but before the second divider is section1
, etc.So, specifying
section="0"
will render just the first section. You may also add a plus sign (+
) to render a section and all sections after it. Sosection="1+"
would show the first section and all other sections as well. -
strftime
- if the structure specified by path is a Date or Time Structure, you may specify a strftime format string in this attribute and it will be used to format the date. In addition to the standard format parameters, Vae also supports a custom%N
format string that provides a “natural” description of the time, such as ‘3 hours ago’. -
transform
- if set touppercase
, text will be turned into uppercase.
Self-closed
This tag is usually self-closed.
Sample Usage
There are a number of possible uses for the <v:text>
tag. We will try
to cover several of them with sample code.
Basic Sample
Formatting Dates
Would render something like this:
This article was written on: September 26, 2008.
Rendering text in a specific font
Rendering a Rich Text Area
Transforming input
Would render:
HELLO WO ...
Number formatting:
Would render:
7,100,000.99