VHS: Fluid ViewHelpers

Extension key

vhs

Package name

fluidtypo3/vhs

Version

main

Language

en

Author

Claus Due, Björn Fromme, Cedric Ziel & Contributors

License

This document is published under the Creative Commons BY 4.0 license.

Rendered

Wed, 03 Sep 2025 11:40:12 +0000


This is a collection of ViewHelpers for performing rendering tasks that are not natively provided by TYPO3's Fluid templating engine. These include advanced formatters, mathematical calculators, special conditions, and iterators and array calculators and processors.


Table of Contents:

Installation

The extension needs to be installed as any other extension of TYPO3 CMS. Get the extension by one of the following methods:

  1. Use composer: Run

    composer require fluidtypo3/vhs
    Copied!

    in your TYPO3 installation.

  2. Get it from the Extension Manager: Switch to the module Admin Tools > Extensions. Switch to Get Extensions and search for the extension key vhs and import the extension from the repository.
  3. Get it from typo3.org: You can always get current version from TER by downloading the zip version. Upload the file afterwards in the Extension Manager.

Configuration

Although there are no static TypoScript files which can be included, VHS does support a few key settings which are defined in TypoScript:

Debug settings

  • plugin.tx_vhs.settings.debug = 1 can be used to enable general debugging, which causes Asset inclusions to be debugged right before inclusion in the page.
  • plugin.tx_vhs.settings.asset.debug = 1 can be used to enable debug output from individual Asset ViewHelper instances. Applies when a ViewHelper uses the "debug" parameter (where this is supported) and/or when plugin.tx_vhs.settings.debug = 1.
  • plugin.tx_vhs.settings.useDebugUtility which causes VHS to use Extbase's DebugUtility to dump variables. If this setting is not defined a value of 1 is assumed.

Usage

These are uses that deserve a special mention. The complete compendium of ViewHelpers can be found on the view-helpers pages.

Table of Contents:

Assets

VHS includes a very useful feature that allows you to define assets (CSS, JavaScript, etc.) in Fluid templates, PHP, and TypoScript. The traditional way of including such assets in Fluid or elsewhere was that they were all used and controlled differently and, probably worst of all, they were not all integration friendly as assets could be modified with TypoScript. VHS Assets solves all of these drawbacks.

Asset examples

The following VHS ViewHelper usage:

<v:asset.script path="fileadmin/demo.js" />
Copied!

is the exact same as this PHP call:

\FluidTYPO3\Vhs\Asset::createFromFile('fileadmin/demo.js');
Copied!

which is a short form of:

\FluidTYPO3\Vhs\Asset::createFromSettings(array(
   'name' => 'demo',
   'path' => 'fileadmin/demo.js'
));
Copied!

which is itself a short form of:

$asset = \FluidTYPO3\Vhs\Asset::getInstance();
// or alternatively, if this fits better in your other code:
$asset = $objectManager->get('FluidTYPO3\\Vhs\\Asset');
// then:
$asset->setName('demo');
$asset->setPath('fileadmin/demo.js');
$asset->finalize(); // manually created Assets must be finalized before they show up.
Copied!

The PHP call above does the exact same as this TypoScript:

plugin.tx_vhs.settings.asset.demo.path = fileadmin/demo.js
Copied!

which is a short form of:

plugin.tx_vhs.settings.asset.demo {
   name = demo
   path = fileadmin/demo.js
}
Copied!

In summary: Regardless of where and how you use VHS Assets, they always use the same attributes, they always behave the same, support the same features (such as dependency on other assets regardless of inclusion order and addressing assets by a group name to affect multiple assets - and even rendering JavaScript and CSS as if the file was a Fluid template).

The API for inclusion changes but the result is the same.

But the real benefit of VHS Assets comes in the form of the TypoScript integration, which lets you override settings of individual assets (regardless of how they were originally defined - Fluid, PHP, TypoScript) by setting their attributes in TypoScript. This allows integrators to control every aspect of every asset (but not the ones included in traditional ways) all the way down to replacing the script source or CSS content that gets inserted or moving JavaScript file(s) which used to be merged, to a new CDN server without even breaking dependencies and execution order.

To affect VHS Assets through TypoScript, the following settings can be used:

Asset settings

plugin.tx_vhs.settings.asset.ASSETNAME {
   content = Text # Text which overrides content
   path = FileReference # If set, turns Asset into a file inclusion
   name = Text a-zA-Z0-9_ # Can be used to change the name of an Asset on-the-fly, but watch out for dependencies
   external = Integer 0/1 # If set to `1` and `standalone`, includes the file as raw URL. If set to `1` and not `standalone` then downloads the file and merges it when building Assets
   overwrite = Integer 0/1 # If set to `1` this Asset is permitted to overwrite existing, identically named Assets
   dependencies = CSV # list of comma-separated Asset names upon which the current Asset depends; affects loading order
   group = Text a-zA-Z0-9_ # Group name, default "fluid". By grouping Assets the settings used on the group will apply to Assets
   debug = Integer 0/1 # If `1` enables debug output of each asset
   standalone = Integer 0/1 # If `1` instructs VHS to process this Asset as standalone, excluding it from merging
   async = Integer 0/1 # If 1, adds "async" attribute to script tag (only works when standalone is set and type is js)
   defer = Integer 0/1 # If 1, adds "defer" attribute to script tag (only works when standalone is set and type is js)
   movable = Integer 0/1 # If `0` prevents Assets from being included in the page footer. Used by style-type Assets. Default is `1` unless type is CSS which forces movable=0
   trim = Integer 0/1 # If `1` enables trimming of whitespace from beginning and end of lines when merging Assets
   namedChunks = Integer 0/1 # If `0` prevents Asset name from being inserted as comment above the Asset body in merged files
}
plugin.tx_vhs.settings.assetGroup.ASSETGROUPNAME {
   # this object supports the following properties only. When applied to a group the settings are used by each
   # Asset in that group, unless overridden directly in the Asset's attributes or through TypoScript as above.
   # SUPPORTED PROPERTIES: overwrite, dependencies, group, debug, standalone, allowMoveToFooter, trim and namedChunks
   # Please note: changing the "group" property changes the name of the group which means another group configuration
   # must be added which configures that group. Otherwise settings may be ignored.
}
plugin.tx_vhs.settings.asset {
   # this object supports every property which "assetGroup" supports except for the "group" and "dependencies" properties.
}
plugin.tx_vhs.assets {
   mergedAssetsUseHashedFilename = 0 # If set to a 1, Assets are merged into a file named using a hash if Assets' names.
   tagsAddSubresourceIntegrity = 0 # If set to 1 (weakest),2 or 3 (strongest), Vhs will generate and add the Subresource Integrity (SRI) for every included Asset.
}
Copied!

Secondary domain name for resources

You can configure VHS to write path prepends in two ways, one of which allows you to create a so-called "cookie-free domain" on which requests will contain fewer headers. Normally, defining config.absRefPrefix causes your resources' paths to be prefixed with a domain, but using this approach will always prepend a domain name which cannot be "cookie-free". VHS allows an alternative setting for path prefix, which can be set to a secondary domain name (pointing to the same virtual host or not) which sets no cookies, causing all asset tags to be written with this prefix prepended:

plugin.tx_vhs.settings.prependPath = https://static.mydomain.com/
Copied!

The setting affects every relative path resource ViewHelper (NB: this does not include links!) in VHS, which is why it is not placed inside the "asset" scope. If you need to output this prefix path in templates, you can use the v:page.staticPrefix ViewHelper - It accepts no arguments and only outputs the setting if it is set. For example, using f:image will not prefix the image path but manually creating an <img /> tag and using f:uri.image as src argument will allow you to prefix the path.

fluidtypo3/vhs

  • 10 ViewHelpers documented
  • 22 Sub namespaces

asset ViewHelper <vhs:asset>

Basic Asset ViewHelper

Places the contents of the asset (the tag body) directly in the additional header content of the page. This most basic possible version of an Asset has only the core features shared by every Asset type:

  • a "name" attribute which is required, identifying the Asset by a lowerCamelCase or lowercase_underscored value, your preference (but lowerCamelCase recommended for consistency).
  • a "dependencies" attribute with a CSV list of other named Assets upon which the current Asset depends. When used, this Asset will be included after every asset listed as dependency.
  • a "group" attribute which is optional and is used ty further identify the Asset as belonging to a particular group which can be suppressed or manipulated through TypoScript. For example, the default value is "fluid" and if TypoScript is used to exclude the group "fluid" then any Asset in that group will simply not be loaded.
  • an "overwrite" attribute which if enabled causes any existing asset with the same name to be overwritten with the current Asset instead. If rendered in a loop only the last instance is actually used (this allows Assets in Partials which are rendered in an f:for loop).
  • a "debug" property which enables output of the information used by the current Asset, with an option to force debug mode through TypoScript.
  • additional properties which affect how the Asset is processed. For a full list see the argument descriptions; the same settings can be applied through TypoScript per-Asset, globally or per-Asset-group.

    Note: there are no static TypoScript templates for VHS but you will find a complete list in the README.md file in the root of the extension folder.

Arguments

content

DataType
string
Required
false
Description
Content to insert in header/footer

path

DataType
string
Required
false
Description
If not using tag content, specify path to file here

external

DataType
boolean
Required
false
Description
If TRUE and standalone, includes the file as raw URL. If TRUE and not standalone then downloads the file and merges it when building Assets

name

DataType
string
Required
false
Description
Optional name of the content. If multiple occurrences of the same name happens, behavior is defined by argument "overwrite"

overwrite

DataType
boolean
Default
true
Required
false
Description
If set to FALSE and a relocated string with "name" already exists, does not overwrite the existing relocated string. Default behavior is to overwrite.

dependencies

DataType
string
Required
false
Description
CSV list of other named assets upon which this asset depends. When included, this asset will always load after its dependencies

group

DataType
string
Default
'fluid'
Required
false
Description
Optional name of a logical group (created dynamically just by using the name) to which this particular asset belongs.

debug

DataType
boolean
Required
false
Description
If TRUE, outputs information about this ViewHelper when the tag is used. Two master debug switches exist in TypoScript; see documentation about Page / Asset ViewHelper

standalone

DataType
boolean
Default
true
Required
false
Description
If TRUE, excludes this Asset from any concatenation which may be applied

rewrite

DataType
boolean
Default
true
Required
false
Description
If FALSE, this Asset will be included as is without any processing of contained urls

fluid

DataType
boolean
Required
false
Description
If TRUE, renders this (standalone or external) Asset as if it were a Fluid template, passing along values of the "variables" attribute or every available template variable if "variables" not specified

variables

DataType
mixed
Required
false
Description
An optional array of arguments which you use inside the Asset, be it standalone or inline. Use this argument to ensure your Asset filenames are only reused when all variables used in the Asset are the same

movable

DataType
boolean
Default
true
Required
false
Description
If TRUE, allows this Asset to be included in the document footer rather than the header. Should never be allowed for CSS.

trim

DataType
boolean
Required
false
Description
DEPRECATED. Trim is no longer supported. Setting this to TRUE doesn't do anything.

namedChunks

DataType
boolean
Required
false
Description
If FALSE, hides the comment containing the name of each of Assets which is merged in a merged file. Disable to avoid a bit more output at the cost of transparency

call ViewHelper <vhs:call>

Call ViewHelper

Calls a method on an existing object. Usable as inline or tag.

Examples

<!-- inline, useful as argument, for example in f:for -->
{object -> v:call(method: 'toArray')}
<!-- tag, useful to quickly output simple values -->
<v:call object="{object}" method="unconventionalGetter" />
<v:call method="unconventionalGetter">{object}</v:call>
<!-- arguments for the method -->
<v:call object="{object}" method="doSomethingWithArguments" arguments="{0: 'foo', 1: 'bar'}" />

Copied!

Arguments

object

DataType
mixed
Required
false
Description
Instance to call method on

method

DataType
string
Required
true
Description
Name of method to call on instance

arguments

DataType
mixed
Default
array ()
Required
false
Description
Array of arguments if method requires arguments

const ViewHelper <vhs:const>

Const ViewHelper

Renders the value of a PHP constant

Arguments

name

DataType
string
Required
false
Description
Name of constant to retrieve

debug ViewHelper <vhs:debug>

ViewHelper Debug ViewHelper (sic)

Debugs instances of other ViewHelpers and language structures. Use in conjunction with other ViewHelpers to inspect their current and possible arguments and render their documentation:

<v:debug><f:format.html>{variable}</f:format.html></v:debug>
Copied!

Or the same expression in inline syntax:

{variable -> f:format.html() -> v:debug()}
Copied!

Can also be used to inspect ObjectAccessor instances (e.g. variables you try to access) and rather than just dumping the entire contents of the variable as is done by <f:debug />, this ViewHelper makes a very simple dump with a warning if the variable is not defined. If an object is encountered (for example a domain object) this ViewHelper will not dump the object but instead will scan it for accessible properties (e.g. properties which have a getter method!) and only present those properties which can be accessed, along with the type of variable that property currently contains:

{domainObject -> v:debug()}
Copied!

Assuming that {domainObject} is an instance of an object which has two methods: getUid() and getTitle(), debugging that instance will render something like this in plain text:

Path: {domainObject}
Value type: object
Accessible properties on {domainObject}:
   {form.uid} (integer)
   {form.title} (string)
Copied!

The class itself can contain any number of protected properties, but only those which have a getter method can be accessed by Fluid and as therefore we only dump those properties which you can in fact access.

Arguments

This ViewHelper has no arguments.

l ViewHelper <vhs:l>

L (localisation) ViewHelper

An extremely shortened and much more dev-friendly alternative to f:translate. Automatically outputs the name of the LLL reference if it is not found and the default value is not set, making it much easier to identify missing labels when translating.

Examples

<v:l>some.label</v:l>
<v:l key="some.label" />
<v:l arguments="{0: 'foo', 1: 'bar'}">some.label</v:l>

Copied!

Arguments

key

DataType
string
Required
false
Description
Translation Key

default

DataType
string
Required
false
Description
If the given locallang key could not be found, this value is used. If this argument is not set, child nodes will be used to render the default

htmlEscape

DataType
boolean
Required
false
Description
TRUE if the result should be htmlescaped. This won't have an effect for the default value

arguments

DataType
mixed
Required
false
Description
Arguments to be replaced in the resulting string

extensionName

DataType
string
Required
false
Description
UpperCamelCased extension key (for example BlogExample)

or ViewHelper <vhs:or>

If content is empty use alternative text (can also be LLL:labelname shortcut or LLL:EXT: file paths).

Arguments

content

DataType
mixed
Required
false
Description
Input to either use, if not empty

alternative

DataType
mixed
Required
false
Description
Alternative if content is empty, can use LLL: shortcut

arguments

DataType
mixed
Required
false
Description
Arguments to be replaced in the resulting string

extensionName

DataType
string
Required
false
Description
UpperCamelCase extension name without vendor prefix

tag ViewHelper <vhs:tag>

Tag building ViewHelper

Creates one HTML tag of any type, with various properties like class and ID applied only if arguments are not empty, rather than apply them always - empty or not - if provided.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

forceClosingTag

DataType
boolean
Required
false
Description
If TRUE, forces the created tag to use a closing tag. If FALSE, allows self-closing tags.

hideIfEmpty

DataType
boolean
Required
false
Description
Hide the tag completely if there is no tag content

contenteditable

DataType
string
Required
false
Description
Specifies whether the contents of the element are editable.

contextmenu

DataType
string
Required
false
Description
The value of the id attribute on the menu with which to associate the element as a context menu.

draggable

DataType
string
Required
false
Description
Specifies whether the element is draggable.

dropzone

DataType
string
Required
false
Description
Specifies what types of content can be dropped on the element, and instructs the UA about which actions to take with content when it is dropped on the element.

translate

DataType
string
Required
false
Description
Specifies whether an elements attribute values and contents of its children are to be translated when the page is localized, or whether to leave them unchanged.

spellcheck

DataType
string
Required
false
Description
Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking.

hidden

DataType
string
Required
false
Description
Specifies that the element represents an element that is not yet, or is no longer, relevant.

name

DataType
string
Required
true
Description
Tag name

try ViewHelper <vhs:try>

Try ViewHelper

Attempts to render child content. If an Exception is encountered while rendering, instead the f:else child node is rendered, if it is present. If f:else is not used, no output is returned.

Can be used to perform complex translations of Exception messages which can occur. Can naturally also be used to provide a great deal of additional information about every possible Exception-type error which Fluid can encounter (and there are many).

Note that this is a Condition ViewHelper which means you can use the f:then child node but it differs from regular Conditions by also allowing the template developer to skip the f:then child node and use the direct tag content as the "TRUE" condition and add an f:else which is only rendered in case of an Exception during rendering.

Also note that you can use the then and else attributes; the then attribute is what is attempted rendered and the else attribute is what is rendered if retrieving the then attribute's value fails. Which clearly only makes sense if for example complex inline ViewHelpers are used in the attributes.

Example usage

Please note that this is a theoretical example!

The example is theoretical in one major aspect: v:format.json.decode throws an Exception which Fluid displays as a string always - abstract from this and imagine that a plain Exception happens on errors.

<v:try>
    <!-- assume that the variable {badJson} contains the string "DontDecodeMe"
         which if course is invalid JSON and cannot be decoded. The default
         behavior is to simply output a simple "cannot decode" string. -->
    <v:variable.set name="decodedBadJson" value="{badJson -> v:format.json.decode()}" />
    Displayed only if the JSON decode worked. Much more code and many more
    ViewHelpers can go here. Now, imagine that this block spans so much code
    that potentially there could come an Exception from many additional places
    (for example from Widgets) and you cannot be sure where the Exception comes
    from but still want to tell the user what exactly went wrong and provide
    an error code which makes sense to send to developers if problems persist:
    <f:else>
        <h4>
            Error in "{exception.trace.0.class
                -> v:iterator.explode(glue: '_')
                -> v:iterator.pop()
                -> v:format.replace(substring: 'ViewHelper', replacement: ''}"
            <small>{exception.code}</small>
            <!-- Output example: "Error in Decode <small>1358440054</small>" -->
        </h4>
        <p>
            {exception.message}
            <!-- Output example: "The provided argument is invalid JSON" -->
        </p>
        <pre>
            Value: ``{exception.trace.0.args.0}
            <!-- Output example: "Value: ``DontDecodeMe" which is quite nice
                 for developers to know as part of a bug report from users. -->
        </pre>
    </f:else>
</v:try>
Copied!

...or if you want a shorter version...

<!-- Tries to encode an object, if it fails, falls back by returning a proper JSON
     value, thus preventing breakage by the JSON consumer whatever it may be. -->
{v:try(then: '{badObject -> v:format.json.encode()}', else: '{"validJson": "validValue"')}
<!-- Note: be VERY careful about the inline JSON syntax! It's very close to Fluids. Always
     double quote your object variables' names, that prevents almost all issues! -->

Copied!

Arguments

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

unless ViewHelper <vhs:unless>

Unless

The opposite of f:if and only supporting negative matching. Related to v:or but allows more complex conditions.

Is the same as writing:

<f:if condition="{theThingToCheck}">
    <f:else>
        The thing that gets done
    </f:else>
</f:if>
Copied!

Except without the f:else.

Example, tag mode

<v:unless condition="{somethingRequired}">
    Warning! Something required was not present.
</v:unless>
Copied!

Example, inline mode illustrating v:or likeness

{defaultText -> v:unless(condition: originalText)}
    // which is much the same as...
{originalText -> v:or(alternative: defaultText}
    // ...but the "unless" counterpart supports anything as
    // condition instead of only checking "is content empty?"

Copied!

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

condition

DataType
boolean
Required
true
Description
Condition which must be true, or then is rendered

asset.prefetch ViewHelper <vhs:asset.prefetch>

Asset DNS Prefetching ViewHelper

Enables the special <link rel="dns-prefetch" /> tag which instructs the browser to start prefetching DNS records for every domain listed in the domains attribute of this ViewHelper. Prefetching starts as soon as the browser becomes aware of the tag - to optimise even further, you may wish to control the output buffer's size to deliver your site HTML in chunks, the first chunk being the one containing this ViewHelper.

Note that the web server daemon may send headers which prevent this prefetching and that these headers can be added in many ways. If prefetching does not work, you will need to inspect the HTTP headers returned from the actual environment. Or you may prefer to simply add force="TRUE" to this tag - but beware that this will affect the entire document's behaviour, not just for this particular set of domain prefetches. Once force-enabled this setting cannot be disabled (unless done so by manually adding an additional meta header tag as examplified by the build() method.

Example usage:

<v:asset.prefetch domains="fedext.net,ajax.google.com" />
Copied!

See: https://developer.mozilla.org/en-US/docs/Controlling_DNS_prefetching

Arguments

content

DataType
string
Required
false
Description
Content to insert in header/footer

path

DataType
string
Required
false
Description
If not using tag content, specify path to file here

external

DataType
boolean
Required
false
Description
If TRUE and standalone, includes the file as raw URL. If TRUE and not standalone then downloads the file and merges it when building Assets

name

DataType
string
Required
false
Description
Optional name of the content. If multiple occurrences of the same name happens, behavior is defined by argument "overwrite"

overwrite

DataType
boolean
Default
true
Required
false
Description
If set to FALSE and a relocated string with "name" already exists, does not overwrite the existing relocated string. Default behavior is to overwrite.

dependencies

DataType
string
Required
false
Description
CSV list of other named assets upon which this asset depends. When included, this asset will always load after its dependencies

group

DataType
string
Default
'fluid'
Required
false
Description
Optional name of a logical group (created dynamically just by using the name) to which this particular asset belongs.

debug

DataType
boolean
Required
false
Description
If TRUE, outputs information about this ViewHelper when the tag is used. Two master debug switches exist in TypoScript; see documentation about Page / Asset ViewHelper

standalone

DataType
boolean
Required
false
Description
If TRUE, excludes this Asset from any concatenation which may be applied

rewrite

DataType
boolean
Default
true
Required
false
Description
If FALSE, this Asset will be included as is without any processing of contained urls

fluid

DataType
boolean
Required
false
Description
If TRUE, renders this (standalone or external) Asset as if it were a Fluid template, passing along values of the "variables" attribute or every available template variable if "variables" not specified

variables

DataType
mixed
Required
false
Description
An optional array of arguments which you use inside the Asset, be it standalone or inline. Use this argument to ensure your Asset filenames are only reused when all variables used in the Asset are the same

movable

DataType
boolean
Default
true
Required
false
Description
If TRUE, allows this Asset to be included in the document footer rather than the header. Should never be allowed for CSS.

trim

DataType
boolean
Required
false
Description
DEPRECATED. Trim is no longer supported. Setting this to TRUE doesn't do anything.

namedChunks

DataType
boolean
Required
false
Description
If FALSE, hides the comment containing the name of each of Assets which is merged in a merged file. Disable to avoid a bit more output at the cost of transparency

domains

DataType
mixed
Required
true
Description
Domain DNS names to prefetch. By default will add all sys_domain record DNS names

protocol

DataType
string
Required
false
Description
Optional value of protocol as inserted in the resulting HREF value. If you experience problems with a non-protocol link, try enforcing http/https here

protocolSeparator

DataType
string
Default
'//'
Required
false
Description
If you do not enforce a particular protocol and wish to remove the double slashes from the hostname (your browser may not understand this!), set this attribute to an empty value (not-zero)

force

DataType
boolean
Required
false
Description
If TRUE, adds an additional meta header tag which forces prefetching to be enabled even if otherwise requested by the http daemon

asset.script ViewHelper <vhs:asset.script>

Basic Script ViewHelper

Allows inserting a <script> Asset. Settings specify where to insert the Asset and how to treat it.

Arguments

content

DataType
string
Required
false
Description
Content to insert in header/footer

path

DataType
string
Required
false
Description
If not using tag content, specify path to file here

external

DataType
boolean
Required
false
Description
If TRUE and standalone, includes the file as raw URL. If TRUE and not standalone then downloads the file and merges it when building Assets

name

DataType
string
Required
false
Description
Optional name of the content. If multiple occurrences of the same name happens, behavior is defined by argument "overwrite"

overwrite

DataType
boolean
Default
true
Required
false
Description
If set to FALSE and a relocated string with "name" already exists, does not overwrite the existing relocated string. Default behavior is to overwrite.

dependencies

DataType
string
Required
false
Description
CSV list of other named assets upon which this asset depends. When included, this asset will always load after its dependencies

group

DataType
string
Default
'fluid'
Required
false
Description
Optional name of a logical group (created dynamically just by using the name) to which this particular asset belongs.

debug

DataType
boolean
Required
false
Description
If TRUE, outputs information about this ViewHelper when the tag is used. Two master debug switches exist in TypoScript; see documentation about Page / Asset ViewHelper

standalone

DataType
boolean
Required
false
Description
If TRUE, excludes this Asset from any concatenation which may be applied

rewrite

DataType
boolean
Default
true
Required
false
Description
If FALSE, this Asset will be included as is without any processing of contained urls

fluid

DataType
boolean
Required
false
Description
If TRUE, renders this (standalone or external) Asset as if it were a Fluid template, passing along values of the "variables" attribute or every available template variable if "variables" not specified

variables

DataType
mixed
Required
false
Description
An optional array of arguments which you use inside the Asset, be it standalone or inline. Use this argument to ensure your Asset filenames are only reused when all variables used in the Asset are the same

movable

DataType
boolean
Default
true
Required
false
Description
If TRUE, allows this Asset to be included in the document footer rather than the header. Should never be allowed for CSS.

trim

DataType
boolean
Required
false
Description
DEPRECATED. Trim is no longer supported. Setting this to TRUE doesn't do anything.

namedChunks

DataType
boolean
Required
false
Description
If FALSE, hides the comment containing the name of each of Assets which is merged in a merged file. Disable to avoid a bit more output at the cost of transparency

async

DataType
boolean
Required
false
Description
If TRUE, adds "async" attribute to script tag (only works when standalone is set)

defer

DataType
boolean
Required
false
Description
If TRUE, adds "defer" attribute to script tag (only works when standalone is set)

asset.style ViewHelper <vhs:asset.style>

Basic Style ViewHelper

Allows inserting a <link> or <style> Asset. Settings specify where to insert the Asset and how to treat it.

Arguments

content

DataType
string
Required
false
Description
Content to insert in header/footer

path

DataType
string
Required
false
Description
If not using tag content, specify path to file here

external

DataType
boolean
Required
false
Description
If TRUE and standalone, includes the file as raw URL. If TRUE and not standalone then downloads the file and merges it when building Assets

name

DataType
string
Required
false
Description
Optional name of the content. If multiple occurrences of the same name happens, behavior is defined by argument "overwrite"

overwrite

DataType
boolean
Default
true
Required
false
Description
If set to FALSE and a relocated string with "name" already exists, does not overwrite the existing relocated string. Default behavior is to overwrite.

dependencies

DataType
string
Required
false
Description
CSV list of other named assets upon which this asset depends. When included, this asset will always load after its dependencies

group

DataType
string
Default
'fluid'
Required
false
Description
Optional name of a logical group (created dynamically just by using the name) to which this particular asset belongs.

debug

DataType
boolean
Required
false
Description
If TRUE, outputs information about this ViewHelper when the tag is used. Two master debug switches exist in TypoScript; see documentation about Page / Asset ViewHelper

standalone

DataType
boolean
Required
false
Description
If TRUE, excludes this Asset from any concatenation which may be applied

rewrite

DataType
boolean
Default
true
Required
false
Description
If FALSE, this Asset will be included as is without any processing of contained urls

fluid

DataType
boolean
Required
false
Description
If TRUE, renders this (standalone or external) Asset as if it were a Fluid template, passing along values of the "variables" attribute or every available template variable if "variables" not specified

variables

DataType
mixed
Required
false
Description
An optional array of arguments which you use inside the Asset, be it standalone or inline. Use this argument to ensure your Asset filenames are only reused when all variables used in the Asset are the same

movable

DataType
boolean
Required
false
Description
If TRUE, allows this Asset to be included in the document footer rather than the header. Should never be allowed for CSS.

trim

DataType
boolean
Required
false
Description
DEPRECATED. Trim is no longer supported. Setting this to TRUE doesn't do anything.

namedChunks

DataType
boolean
Required
false
Description
If FALSE, hides the comment containing the name of each of Assets which is merged in a merged file. Disable to avoid a bit more output at the cost of transparency

condition

  • 0 ViewHelpers documented
  • 7 Sub namespaces

condition.context.isBackend ViewHelper <vhs:condition.context.isBackend>

Condition: Is context Backend?

A condition ViewHelper which renders the then child if current context being rendered is BE.

Examples

<!-- simple usage, content becomes then-child -->
<v:condition.context.isBackend>
    Hooray for BE contexts!
</v:condition.context.isBackend>
<!-- extended use combined with f:then and f:else -->
<v:condition.context.isBackend>
    <f:then>
       Hooray for BE contexts!
    </f:then>
    <f:else>
       Maybe FE, maybe CLI.
    </f:else>
</v:condition.context.isBackend>

Copied!

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

condition.context.isCli ViewHelper <vhs:condition.context.isCli>

Condition: Is context CLI?

A condition ViewHelper which renders the then child if current context being rendered is CLI.

Examples

<!-- simple usage, content becomes then-child -->
<v:condition.context.isCli>
    Hooray for CLI contexts!
</v:condition.context.isCli>
<!-- extended use combined with f:then and f:else -->
<v:condition.context.isCli>
    <f:then>
       Hooray for CLI contexts!
    </f:then>
    <f:else>
       Maybe BE, maybe FE.
    </f:else>
</v:condition.context.isCli>

Copied!

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

condition.context.isDevelopment ViewHelper <vhs:condition.context.isDevelopment>

Context: IsDevelopment

Returns true if current root application context is development otherwise false. If no application context has been set, then the default context is production.

Note about how to set the application context

The context TYPO3 CMS runs in is specified through the environment variable TYPO3_CONTEXT. It can be set by .htaccess or in the server configuration

See: http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Bootstrapping/Index.html#bootstrapping-context

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

condition.context.isFrontend ViewHelper <vhs:condition.context.isFrontend>

Condition: Is context Frontend?

A condition ViewHelper which renders the then child if current context being rendered is FE.

Examples

<!-- simple usage, content becomes then-child -->
<v:condition.context.isFrontend>
    Hooray for BE contexts!
</v:condition.context.isFrontend>
<!-- extended use combined with f:then and f:else -->
<v:condition.context.isFrontend>
    <f:then>
       Hooray for BE contexts!
    </f:then>
    <f:else>
       Maybe BE, maybe CLI.
    </f:else>
</v:condition.context.isFrontend>

Copied!

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

condition.context.isProduction ViewHelper <vhs:condition.context.isProduction>

Context: IsProduction

Returns true if current root application context is production otherwise false. If no application context has been set, then this is the default context.

Note about how to set the application context

The context TYPO3 CMS runs in is specified through the environment variable TYPO3_CONTEXT. It can be set by .htaccess or in the server configuration

See: http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Bootstrapping/Index.html#bootstrapping-context

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

condition.context.isTesting ViewHelper <vhs:condition.context.isTesting>

Context: IsProduction

Returns true if current root application context is testing otherwise false. If no application context has been set, then the default context is production.

Note about how to set the application context

The context TYPO3 CMS runs in is specified through the environment variable TYPO3_CONTEXT. It can be set by .htaccess or in the server configuration

See: http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Bootstrapping/Index.html#bootstrapping-context

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

condition.form.hasValidator ViewHelper <vhs:condition.form.hasValidator>

Form: Field Has Validator?

Takes a property (dotted path supported) and renders the then-child if the property at the given path has any

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

property

DataType
string
Required
true
Description
The property name, dotted path supported, to determine required.

validatorName

DataType
string
Required
true
Description
The name of the validator that must exist for the condition to be true.

object

DataType
mixed
Required
true
Description
Optional object - if not specified, grabs the associated form object.

condition.form.isRequired ViewHelper <vhs:condition.form.isRequired>

Is Field Required ViewHelper (condition)

Takes a property (dotted path supported) and renders the then-child if the property at the given path has an

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

property

DataType
string
Required
true
Description
The property name, dotted path supported, to determine required.

validatorName

DataType
string
Required
true
Description
The name of the validator that must exist for the condition to be true.

object

DataType
mixed
Required
true
Description
Optional object - if not specified, grabs the associated form object.

condition.iterator.contains ViewHelper <vhs:condition.iterator.contains>

Condition ViewHelper. Renders the then-child if Iterator/array haystack contains needle value.

Example:

{v:condition.iterator.contains(needle: 'foo', haystack: {0: 'foo'}, then: 'yes', else: 'no')}

Copied!

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

needle

DataType
mixed
Required
true
Description
Needle to search for in haystack

haystack

DataType
mixed
Required
true
Description
Haystack in which to look for needle

considerKeys

DataType
boolean
Required
false
Description
Tell whether to consider keys in the search assuming haystack is an array.

condition.page.hasSubpages ViewHelper <vhs:condition.page.hasSubpages>

Condition: Page has subpages

A condition ViewHelper which renders the then child if current page or page with provided UID has subpages. By default disabled subpages are considered non existent which can be overridden by setting $includeHidden to TRUE. To include pages that are hidden in menus set $showHiddenInMenu to TRUE.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

pageUid

DataType
integer
Required
false
Description
Parent page to check

includeHidden

DataType
boolean
Required
false
Description
DEPRECATED: Include hidden pages

includeAccessProtected

DataType
boolean
Required
false
Description
Include access protected pages

includeHiddenInMenu

DataType
boolean
Required
false
Description
Include pages hidden in menu

condition.page.isChildPage ViewHelper <vhs:condition.page.isChildPage>

Condition: Page is child page

Condition ViewHelper which renders the then child if current page or page with provided UID is a child of some other page in the page tree. If $respectSiteRoot is set to TRUE root pages are never considered child pages even if they are.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

pageUid

DataType
integer
Required
false
Description
Value to check

respectSiteRoot

DataType
boolean
Required
false
Description
Value to check

condition.page.isLanguage ViewHelper <vhs:condition.page.isLanguage>

Condition: Is current language

A condition ViewHelper which renders the then child if current language matches the provided language uid or language title. When using language titles like 'de' it is required to provide a default title to distinguish between the standard and a non existing language.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

language

DataType
string
Required
true
Description
Language to check

defaultTitle

DataType
string
Default
'en'
Required
false
Description
Title of the default language

condition.string.contains ViewHelper <vhs:condition.string.contains>

Condition: String contains substring

Condition ViewHelper which renders the then child if provided string $haystack contains provided string $needle.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

haystack

DataType
string
Required
true
Description
Haystack

needle

DataType
string
Required
true
Description
Need

condition.string.isLowercase ViewHelper <vhs:condition.string.isLowercase>

Condition: String is lowercase

Condition ViewHelper which renders the then child if provided string is lowercase. By default only the first letter is tested. To test the full string set $fullString to TRUE.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

string

DataType
string
Required
true
Description
String to check

fullString

DataType
string
Required
false
Description
Need

condition.string.isNumeric ViewHelper <vhs:condition.string.isNumeric>

Condition: Value is numeric

Condition ViewHelper which renders the then child if provided value is numeric.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

condition.string.isUppercase ViewHelper <vhs:condition.string.isUppercase>

Condition: String is lowercase

Condition ViewHelper which renders the then child if provided string is uppercase. By default only the first letter is tested. To test the full string set $fullString to TRUE.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

string

DataType
string
Required
true
Description
String to check

fullString

DataType
string
Required
false
Description
Need

condition.type.isArray ViewHelper <vhs:condition.type.isArray>

Condition: Type of value is array

Condition ViewHelper which renders the then child if type of provided value is array.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

condition.type.isBoolean ViewHelper <vhs:condition.type.isBoolean>

Condition: Type of value is a boolean

Condition ViewHelper which renders the then child if type of provided value is a boolean.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

condition.type.isDomainObject ViewHelper <vhs:condition.type.isDomainObject>

Condition: Value is a domain object

Condition ViewHelper which renders the then child if provided value is a domain object, i.e. it inherits from extbase's base class.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

fullString

DataType
string
Required
false
Description
Need

condition.type.isFloat ViewHelper <vhs:condition.type.isFloat>

Condition: Type of value is float

Condition ViewHelper which renders the then child if type of provided value is float.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

condition.type.isInstanceOf ViewHelper <vhs:condition.type.isInstanceOf>

Condition: Value is an instance of a class

Condition ViewHelper which renders the then child if provided value is an instance of provided class name.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

class

DataType
mixed
Required
true
Description
ClassName to check against

condition.type.isInteger ViewHelper <vhs:condition.type.isInteger>

Condition: Type of value is integer

Condition ViewHelper which renders the then child if type of provided value is integer.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

condition.type.isObject ViewHelper <vhs:condition.type.isObject>

Condition: Value is an object

Condition ViewHelper which renders the then child if provided value is an object.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

condition.type.isQueryResult ViewHelper <vhs:condition.type.isQueryResult>

Condition: Value is a query result

Condition ViewHelper which renders the then child if provided value is an extbase query result.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

condition.type.isString ViewHelper <vhs:condition.type.isString>

Condition: Type of value is string

Condition ViewHelper which renders the then child if type of provided value is string.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

condition.type.isTraversable ViewHelper <vhs:condition.type.isTraversable>

Condition: Value implements interface Traversable

Condition ViewHelper which renders the then child if provided value implements interface Traversable.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
mixed
Required
true
Description
Value to check

condition.variable.isNull ViewHelper <vhs:condition.variable.isNull>

Condition: Value is NULL

Condition ViewHelper which renders the then child if provided value is NULL.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

value

DataType
string
Required
true
Description
Value to check

condition.variable.isset ViewHelper <vhs:condition.variable.isset>

Variable: Isset

Renders the then child if the variable name given in the name argument exists in the template. The value can be zero, NULL or an empty string - but the ViewHelper will still return TRUE if the variable exists.

Combines well with dynamic variable names:

<!-- if {variableContainingVariableName} is "foo" this checks existence of {foo} -->
<v:condition.variable.isset name="{variableContainingVariableName}">...</v:condition.variable.isset>
<!-- if {suffix} is "Name" this checks existence of "variableName" -->
<v:condition.variable.isset name="variable{suffix}">...</v:condition.variable.isset>
<!-- outputs value of {foo} if {bar} is defined -->
{foo -> v:condition.variable.isset(name: bar)}
Copied!

ONLY WORKS ON TYPO3v8+!

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

name

DataType
string
Required
true
Description
Name of the variable

content.get ViewHelper <vhs:content.get>

ViewHelper used to render get content elements in Fluid templates

Does not work in the TYPO3 backend.

Arguments

column

DataType
integer
Required
false
Description
Column position number (colPos) of the column to render

order

DataType
string
Default
'sorting'
Required
false
Description
Optional sort field of content elements - RAND() supported. Note that when sliding is enabled, the sorting will be applied to records on a per-page basis and not to the total set of collected records.

sortDirection

DataType
string
Default
'ASC'
Required
false
Description
Optional sort direction of content elements

pageUid

DataType
integer
Required
false
Description
If set, selects only content from this page UID. Ignored when "contentUids" is specified.

contentUids

DataType
mixed
Required
false
Description
If used, replaces all conditions with an "uid IN (1,2,3)" style condition using the UID values from this array

sectionIndexOnly

DataType
boolean
Required
false
Description
If TRUE, only renders/gets content that is marked as "include in section index"

loadRegister

DataType
mixed
Required
false
Description
List of LOAD_REGISTER variable

render

DataType
boolean
Required
false
Description
Return rendered result

hideUntranslated

DataType
boolean
Required
false
Description
If FALSE, will NOT include elements which have NOT been translated, if current language is NOT the default language. Default is to show untranslated elements but never display the original if there is a translated version

limit

DataType
integer
Required
false
Description
Optional limit to the total number of records to render

slide

DataType
integer
Required
false
Description
Enables Record Sliding - amount of levels which shall get walked up the rootline, including the current page. For infinite sliding (till the rootpage) set to -1. Only the first PID which has at minimum one record is used.

slideCollect

DataType
integer
Required
false
Description
If TRUE, content is collected up the root line. If FALSE, only the first PID which has content is used. If greater than zero, this value overrides $slide.

slideCollectReverse

DataType
boolean
Required
false
Description
Normally when collecting records the elements from the actual page get shown on the top and those from the parent pages below those. You can invert this behaviour (actual page elements at bottom) by setting this flag.

content.info ViewHelper <vhs:content.info>

ViewHelper to access data of the current content element record.

Arguments

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

contentUid

DataType
integer
Required
false
Description
If specified, this UID will be used to fetch content element data instead of using the current content element.

field

DataType
string
Required
false
Description
If specified, only this field will be returned/assigned instead of the complete content element record.

content.render ViewHelper <vhs:content.render>

ViewHelper used to render content elements in Fluid templates.

Render a single content element by its UID

Let's assume that the variable settings.element.uid contains the uid of a content element. It can be rendered as follows:

<v:content.render contentUids="{0: settings.element.uid}"/>

Copied!

Arguments

column

DataType
integer
Required
false
Description
Column position number (colPos) of the column to render

order

DataType
string
Default
'sorting'
Required
false
Description
Optional sort field of content elements - RAND() supported. Note that when sliding is enabled, the sorting will be applied to records on a per-page basis and not to the total set of collected records.

sortDirection

DataType
string
Default
'ASC'
Required
false
Description
Optional sort direction of content elements

pageUid

DataType
integer
Required
false
Description
If set, selects only content from this page UID. Ignored when "contentUids" is specified.

contentUids

DataType
mixed
Required
false
Description
If used, replaces all conditions with an "uid IN (1,2,3)" style condition using the UID values from this array

sectionIndexOnly

DataType
boolean
Required
false
Description
If TRUE, only renders/gets content that is marked as "include in section index"

loadRegister

DataType
mixed
Required
false
Description
List of LOAD_REGISTER variable

render

DataType
boolean
Default
true
Required
false
Description
Render result

hideUntranslated

DataType
boolean
Required
false
Description
If FALSE, will NOT include elements which have NOT been translated, if current language is NOT the default language. Default is to show untranslated elements but never display the original if there is a translated version

limit

DataType
integer
Required
false
Description
Optional limit to the total number of records to render

slide

DataType
integer
Required
false
Description
Enables Record Sliding - amount of levels which shall get walked up the rootline, including the current page. For infinite sliding (till the rootpage) set to -1. Only the first PID which has at minimum one record is used.

slideCollect

DataType
integer
Required
false
Description
If TRUE, content is collected up the root line. If FALSE, only the first PID which has content is used. If greater than zero, this value overrides $slide.

slideCollectReverse

DataType
boolean
Required
false
Description
Normally when collecting records the elements from the actual page get shown on the top and those from the parent pages below those. You can invert this behaviour (actual page elements at bottom) by setting this flag.

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

content.resources ViewHelper <vhs:content.resources>

Resources ViewHelper

Loads FAL records associated with records of arbitrary types.

Arguments

table

DataType
string
Default
'tt_content'
Required
false
Description
The table to lookup records.

field

DataType
string
Default
'image'
Required
false
Description
The field of the table associated to resources.

record

DataType
mixed
Required
false
Description
The actual record. Alternatively you can use the "uid" argument.

uid

DataType
integer
Required
false
Description
The uid of the record. Alternatively you can use the "record" argument.

as

DataType
string
Required
false
Description
If specified, a template variable with this name containing the requested data will be inserted instead of returning it.

content.random.get ViewHelper <vhs:content.random.get>

ViewHelper for fetching a random content element in Fluid page templates.

Arguments

column

DataType
integer
Required
false
Description
Column position number (colPos) of the column to render

order

DataType
string
Default
'sorting'
Required
false
Description
Optional sort field of content elements - RAND() supported. Note that when sliding is enabled, the sorting will be applied to records on a per-page basis and not to the total set of collected records.

sortDirection

DataType
string
Default
'ASC'
Required
false
Description
Optional sort direction of content elements

pageUid

DataType
integer
Required
false
Description
If set, selects only content from this page UID. Ignored when "contentUids" is specified.

contentUids

DataType
mixed
Required
false
Description
If used, replaces all conditions with an "uid IN (1,2,3)" style condition using the UID values from this array

sectionIndexOnly

DataType
boolean
Required
false
Description
If TRUE, only renders/gets content that is marked as "include in section index"

loadRegister

DataType
mixed
Required
false
Description
List of LOAD_REGISTER variable

render

DataType
boolean
Required
false
Description
Returning variable as original table rows

hideUntranslated

DataType
boolean
Required
false
Description
If FALSE, will NOT include elements which have NOT been translated, if current language is NOT the default language. Default is to show untranslated elements but never display the original if there is a translated version

limit

DataType
integer
Default
1
Required
false
Description
Optional limit number of content elements to render

slide

DataType
integer
Required
false
Description
Enables Record Sliding - amount of levels which shall get walked up the rootline, including the current page. For infinite sliding (till the rootpage) set to -1. Only the first PID which has at minimum one record is used.

slideCollect

DataType
integer
Required
false
Description
If TRUE, content is collected up the root line. If FALSE, only the first PID which has content is used. If greater than zero, this value overrides $slide.

slideCollectReverse

DataType
boolean
Required
false
Description
Normally when collecting records the elements from the actual page get shown on the top and those from the parent pages below those. You can invert this behaviour (actual page elements at bottom) by setting this flag.

content.random.render ViewHelper <vhs:content.random.render>

ViewHelper for rendering a random content element in Fluid page templates.

Arguments

column

DataType
integer
Required
false
Description
Column position number (colPos) of the column to render

order

DataType
string
Default
'sorting'
Required
false
Description
Optional sort field of content elements - RAND() supported. Note that when sliding is enabled, the sorting will be applied to records on a per-page basis and not to the total set of collected records.

sortDirection

DataType
string
Default
'ASC'
Required
false
Description
Optional sort direction of content elements

pageUid

DataType
integer
Required
false
Description
If set, selects only content from this page UID. Ignored when "contentUids" is specified.

contentUids

DataType
mixed
Required
false
Description
If used, replaces all conditions with an "uid IN (1,2,3)" style condition using the UID values from this array

sectionIndexOnly

DataType
boolean
Required
false
Description
If TRUE, only renders/gets content that is marked as "include in section index"

loadRegister

DataType
mixed
Required
false
Description
List of LOAD_REGISTER variable

render

DataType
boolean
Default
true
Required
false
Description
Render result

hideUntranslated

DataType
boolean
Required
false
Description
If FALSE, will NOT include elements which have NOT been translated, if current language is NOT the default language. Default is to show untranslated elements but never display the original if there is a translated version

limit

DataType
integer
Default
1
Required
false
Description
Optional limit number of content elements to render

slide

DataType
integer
Required
false
Description
Enables Record Sliding - amount of levels which shall get walked up the rootline, including the current page. For infinite sliding (till the rootpage) set to -1. Only the first PID which has at minimum one record is used.

slideCollect

DataType
integer
Required
false
Description
If TRUE, content is collected up the root line. If FALSE, only the first PID which has content is used. If greater than zero, this value overrides $slide.

slideCollectReverse

DataType
boolean
Required
false
Description
Normally when collecting records the elements from the actual page get shown on the top and those from the parent pages below those. You can invert this behaviour (actual page elements at bottom) by setting this flag.

content.resources.fal ViewHelper <vhs:content.resources.fal>

Content FAL relations ViewHelper

Render a single image in a content element

We assume that the flux content element has an IRRE file field <flux:field.inline.fal name="settings.image">.

The file data can be loaded and displayed with:

{v:content.resources.fal(field: 'settings.image')
  -> v:iterator.first()
  -> v:variable.set(name: 'image')}
<f:if condition="{image}">
  <f:image src="{image.uid}"/>
</f:if>

Copied!

Image preview in backend

To load image data for the "Preview" section in the backend's page view, you have to pass the record attribute:

{v:content.resources.fal(field: 'settings.image', record: record)}

Copied!

Arguments

table

DataType
string
Default
'tt_content'
Required
false
Description
The table to lookup records.

field

DataType
string
Default
'image'
Required
false
Description
The field of the table associated to resources.

record

DataType
mixed
Required
false
Description
The actual record. Alternatively you can use the "uid" argument.

uid

DataType
integer
Required
false
Description
The uid of the record. Alternatively you can use the "record" argument.

as

DataType
string
Required
false
Description
If specified, a template variable with this name containing the requested data will be inserted instead of returning it.

asObjects

DataType
boolean
Required
false
Description
Can be set to TRUE to return objects instead of file information arrays.

context.get ViewHelper <vhs:context.get>

Context: Get

Returns the current application context which may include possible sub-contexts. The application context can be 'Production', 'Development' or 'Testing'. Additionally each context can be extended with custom sub-contexts like: 'Production/Staging' or 'Production/Staging/Server1'. If no application context has been set by the configuration, then the default context is 'Production'.

Note about how to set the application context

The context TYPO3 CMS runs in is specified through the environment variable TYPO3_CONTEXT. It can be set by .htaccess or in the server configuration

See: http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Bootstrapping/Index.html#bootstrapping-context

Arguments

This ViewHelper has no arguments.

count.bytes ViewHelper <vhs:count.bytes>

Counts bytes (multibyte-safe) in a string.

Usage examples

<v:count.bytes>{myString}</v:count.bytes> (output for example `42`
Copied!
{myString -> v:count.bytes()} when used inline
Copied!
<v:count.bytes string="{myString}" />
Copied!
{v:count.bytes(string: myString)}

Copied!

Arguments

string

DataType
string
Required
false
Description
String to count, if not provided as tag content

encoding

DataType
string
Default
'UTF-8'
Required
false
Description
Character set encoding of string, e.g. UTF-8 or ISO-8859-1

count.lines ViewHelper <vhs:count.lines>

Counts number of lines in a string.

Usage examples

<v:count.lines>{myString}</v:count.lines> (output for example `42`
Copied!
{myString -> v:count.lines()} when used inline
Copied!
<v:count.lines string="{myString}" />
Copied!
{v:count.lines(string: myString)}

Copied!

Arguments

string

DataType
string
Required
false
Description
String to count, if not provided as tag content

count.substring ViewHelper <vhs:count.substring>

Counts number of lines in a string.

Usage examples

<v:count.substring string="{myString}">{haystack}</v:count.substring> (output for example `2`
Copied!
{haystack -> v:count.substring(string: myString)} when used inline
Copied!
<v:count.substring string="{myString}" haystack="{haystack}" />
Copied!
{v:count.substring(string: myString, haystack: haystack)}

Copied!

Arguments

haystack

DataType
string
Required
false
Description
String to count substring in, if not provided as tag content

string

DataType
string
Required
true
Description
Substring to count occurrences of

count.words ViewHelper <vhs:count.words>

Counts words in a string.

Usage examples

<v:count.words>{myString}</v:count.words> (output for example `42`
Copied!
{myString -> v:count.words()} when used inline
Copied!
<v:count.words string="{myString}" />
Copied!
{v:count.words(string: myString)}

Copied!

Arguments

string

DataType
string
Required
false
Description
String to count, if not provided as tag content

extension.icon ViewHelper <vhs:extension.icon>

Extension: Icon ViewHelper

Outputs the icon of the extension key. Supports both extension key and extension name arguments.

Arguments

extensionName

DataType
string
Required
false
Description
Name, in UpperCamelCase, of the extension to be checked

extension.loaded ViewHelper <vhs:extension.loaded>

Extension: Loaded (Condition) ViewHelper

Condition to check if an extension is loaded.

Example:

{v:extension.loaded(extensionName: 'news', then: 'yes', else: 'no')}
Copied!
<v:extension.loaded extensionName="news">
    ...
</v:extension.loaded>

Copied!

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

extensionName

DataType
string
Required
true
Description
Name of extension that must be loaded in order to evaluate as TRUE, UpperCamelCase

extension.path.absolute ViewHelper <vhs:extension.path.absolute>

Path: Absolute Extension Folder Path

Returns the absolute path to an extension folder.

Arguments

extensionName

DataType
string
Required
false
Description
Name, in UpperCamelCase, of the extension to be checked

path

DataType
string
Required
false
Description
Optional path to append, second argument when calling TYPO3CMSCoreUtilityExtensionManagementUtility::extPath

extension.path.relative ViewHelper <vhs:extension.path.relative>

Path: Relative Extension Folder Path

Returns the relative path to an Extension folder.

Arguments

extensionName

DataType
string
Required
false
Description
Name, in UpperCamelCase, of the extension to be checked

extension.path.resources ViewHelper <vhs:extension.path.resources>

Path: Relative Extension Resource Path

Site Relative path to Extension Resources/Public folder.

Arguments

extensionName

DataType
string
Required
false
Description
Name, in UpperCamelCase, of the extension to be checked

path

DataType
string
Required
false
Description
Optional path to append after output of TYPO3CMSCoreUtilityExtensionManagementUtility::extRelPath

extension.path.siteRelative ViewHelper <vhs:extension.path.siteRelative>

Path: Relative Extension Folder Path

Returns the site relative path to an extension folder.

Arguments

extensionName

DataType
string
Required
false
Description
Name, in UpperCamelCase, of the extension to be checked

form.fieldName ViewHelper <vhs:form.fieldName>

Form Field Name View Helper

This viewhelper returns the properly prefixed name of the given form field and generates the corresponding HMAC to allow posting of dynamically added fields.

Arguments

name

DataType
string
Required
false
Description
Name of the form field to generate the HMAC for.

property

DataType
string
Required
false
Description
Name of object property. If used in conjunction with <f:form object="...">, "name" argument will be ignored.

format.append ViewHelper <vhs:format.append>

Format: Append string content

Appends a string after another string. Although this task is very easily done in standard Fluid - i.e. {subject}{add} - this ViewHelper makes advanced chained inline processing possible:

<!-- useful when needing to chain string processing. Remove all "foo" and "bar"
     then add a text containing both "foo" and "bar", then format as HTML -->
{text -> v:format.eliminate(strings: 'foo,bar')
      -> v:format.append(add: ' - my foo and bar are the only ones in this text.')
      -> f:format.html()}
<!-- NOTE: you do not have to break the lines; done here only for presentation purposes -->
Copied!

Makes no sense used as tag based ViewHelper:

<!-- DO NOT USE - depicts COUNTERPRODUCTIVE usage! -->
<v:format.append add="{f:translate(key: 're')}">{subject}</v:format.append>
<!-- ... which is the exact same as ... -->
<f:translate key="re" />{subject} <!-- OR --> {f:translate(key: 're')}{subject}
Copied!

In other words: use this only when you do not have the option of simply using {subject}{add}, i.e. in complex inline statements used as attribute values on other ViewHelpers (where tag usage is undesirable).

Arguments

subject

DataType
string
Required
false
Description
String to append other string to

add

DataType
string
Required
false
Description
String to append

format.case ViewHelper <vhs:format.case>

Case Formatting ViewHelper

Formats string case according to provided arguments.

Arguments

string

DataType
string
Required
false
Description
String to case format

case

DataType
string
Required
false
Description
Case to convert to

format.dateRange ViewHelper <vhs:format.dateRange>

Date range calculation/formatting ViewHelper

Uses DateTime and DateInterval operations to calculate a range between two DateTimes.

Usages

  • As formatter, the ViewHelper can output a string value such as "2013-04-30 - 2013-05-30" where you can configure both the start and end date (or their common) formats as well as the "glue" which binds the two dates together.
  • As interval calculator, the ViewHelper can be used with a special "intervalFormat" which is a string used in the constructor method for the DateInterval class - for example, "P3M" to add three months. Used this way, you can specify the start date (or rely on the default "now" DateTime) and specify the "intervalFormat" to add your desired duration to your starting date and use that as end date. Without the "return" attribute, this mode simply outputs the formatted dates with interval deciding the end date.
  • When used with the "return" attribute you can specify which type of data to return: - if "return" is "DateTime", a single DateTime instance is returned (which is the end date). Use this with a start date to return the DateTime corresponding to "intervalFormat" into the future/past. - if "return" is a string such as "w", "d", "h" etc. the corresponding counter value (weeks, days, hours etc.) is returned. - if "return" is an array of counter IDs, for example ["w", "d"], the corresponding counters from the range are returned as an array.

Note about LLL support and array consumers

When used with the "return" attribute and when this attribute is an array, the output becomes suitable for consumption by f:translate, v:l or f:format.sprintf for example - as the "arguments" attribute:

<f:translate key="myDateDisplay"
    arguments="{v:format.dateRange(intervalFormat: 'P3W', return: {0: 'w', 1: 'd'})}"
/>
Copied!

Which if "myDateDisplay" is a string such as "Deadline: %d week(s) and %d day(s)" would output a result such as "Deadline: 4 week(s) and 2 day(s)".

Tip: the values returned by this ViewHelper in both array and single value return modes, are also nicely consumable by the "math" suite of ViewHelpers, for example v:math.division would be able to divide number of days by two, three etc. to further divide the date range.

Arguments

start

DataType
mixed
Default
'now'
Required
false
Description
Start date which can be a DateTime object or a string consumable by DateTime constructor

end

DataType
mixed
Required
false
Description
End date which can be a DateTime object or a string consumable by DateTime constructor

intervalFormat

DataType
string
Required
false
Description
Interval format consumable by DateInterval

format

DataType
string
Default
'Y-m-d'
Required
false
Description
Date format to apply to both start and end date

startFormat

DataType
string
Required
false
Description
Date format to apply to start date

endFormat

DataType
string
Required
false
Description
Date format to apply to end date

glue

DataType
string
Default
'-'
Required
false
Description
Glue string to concatenate dates with

spaceGlue

DataType
boolean
Default
true
Required
false
Description
If TRUE glue string is surrounded with whitespace

return

DataType
mixed
Required
false
Description
Return type; can be exactly "DateTime" to return a DateTime instance, a string like "w" or "d" to return weeks, days between the two dates - or an array of w, d, etc. strings to return the corresponding range count values as an array.

format.eliminate ViewHelper <vhs:format.eliminate>

Character/string/whitespace elimination ViewHelper

There is no example - each argument describes how it should be used and arguments can be used individually or in any combination.

Arguments

content

DataType
string
Required
false
Description
String in which to perform replacement

caseSensitive

DataType
boolean
Default
true
Required
false
Description
Wether or not to perform case sensitive replacement

characters

DataType
mixed
Required
false
Description
Characters to remove. Array or string, i.e. {0: 'a', 1: 'b', 2: 'c'} or 'abc' to remove all occurrences of a, b and c

strings

DataType
mixed
Required
false
Description
Strings to remove. Array or CSV, i.e. {0: 'foo', 1: 'bar'} or 'foo,bar' to remove all occorrences of foo and bar. If your strings overlap then place the longest match first

whitespace

DataType
boolean
Required
false
Description
Eliminate ALL whitespace characters

whitespaceBetweenHtmlTags

DataType
boolean
Required
false
Description
Eliminate ALL whitespace characters between HTML tags. Use this together with <f:format.raw>

tabs

DataType
boolean
Required
false
Description
Eliminate only tab whitespaces

unixBreaks

DataType
boolean
Required
false
Description
Eliminate only UNIX line breaks

windowsBreaks

DataType
boolean
Required
false
Description
Eliminates only Windows carriage returns

digits

DataType
boolean
Required
false
Description
Eliminates all number characters (but not the dividers between floats converted to strings)

letters

DataType
boolean
Required
false
Description
Eliminates all letters (non-numbers, non-whitespace, non-syntactical)

nonAscii

DataType
boolean
Required
false
Description
Eliminates any ASCII char

format.hash ViewHelper <vhs:format.hash>

Hashes a string.

Arguments

content

DataType
mixed
Required
false
Description
Content to hash

algorithm

DataType
string
Default
'sha256'
Required
false
Description
Hashing algorithm to use (see http://php.net/manual/en/function.hash-algos.php for details)

format.hide ViewHelper <vhs:format.hide>

Hides output from browser, but still renders tag content which means any ViewHelper inside the tag content still gets processed.

Arguments

disabled

DataType
boolean
Required
false
Description
If TRUE, renders content - use to quickly enable/disable Fluid code

format.markdown ViewHelper <vhs:format.markdown>

Markdown Transformation ViewHelper

Requires an installed "markdown" utility, the specific implementation is less important since Markdown has no configuration options. However, the utility or shell scipt must:

  • accept input from STDIN
  • output to STDOUT
  • place errors in STDERR
  • be executable according to open_basedir and others
  • exist within (one or more of) TYPO3's configured executable paths

In other words, *NIX standard behavior must be used.

See: http://daringfireball.net/projects/markdown

Arguments

text

DataType
string
Required
false
Description
Markdown to convert to HTML

trim

DataType
boolean
Default
true
Required
false
Description
Trim content before converting

htmlentities

DataType
boolean
Required
false
Description
If true, escapes converted HTML

format.plaintext ViewHelper <vhs:format.plaintext>

Processes output as plaintext. Will trim whitespace off each line that is provided, making display in a <pre> work correctly indented even if the source is not.

Expects that you use f:format.htmlentities or similar if you do not want HTML to be displayed as HTML, or simply want it stripped out.

Arguments

content

DataType
string
Required
false
Description
Content to trim each line of text within

format.pregReplace ViewHelper <vhs:format.pregReplace>

PregReplace regular expression ViewHelper

Implementation of preg_replace for Fluid.

Arguments

subject

DataType
string
Required
false
Description
String to match with the regex pattern or patterns

pattern

DataType
string
Required
true
Description
Regex pattern to match against

replacement

DataType
string
Required
true
Description
String to replace matches with

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

format.prepend ViewHelper <vhs:format.prepend>

Format: Prepend string content

Prepends one string on another. Although this task is very easily done in standard Fluid - i.e. {add}{subject} - this ViewHelper makes advanced chained inline processing possible:

<!-- Adds 1H to DateTime, formats using timestamp input which requires prepended @ -->
{dateTime.timestamp
    -> v:math.sum(b: 3600)
    -> v:format.prepend(add: '@')
    -> v:format.date(format: 'Y-m-d H:i')}
<!-- You don't have to break the syntax into lines; done here for display only -->

Copied!

Arguments

subject

DataType
string
Required
false
Description
String to prepend other string to

add

DataType
string
Required
false
Description
String to prepend

format.replace ViewHelper <vhs:format.replace>

Replaces $substring in $content with $replacement.

Supports array as input substring/replacements and content.

When input substring/replacement is an array, both must be the same length and must contain only strings.

When input content is an array, the search/replace is done on every value in the input content array and the return value will be an array of equal size as the input content array but with all values search/replaced. All values in the input content array must be strings.

Arguments

content

DataType
string
Required
false
Description
Content in which to perform replacement. Array supported.

substring

DataType
string
Required
true
Description
Substring to replace. Array supported.

replacement

DataType
string
Required
false
Description
Replacement to insert. Array supported.

returnCount

DataType
boolean
Required
false
Description
If TRUE, returns the number of replacements that were performed instead of returning output string. See also v:count.substring.

caseSensitive

DataType
boolean
Default
true
Required
false
Description
If true, perform case-sensitive replacement

format.sanitizeString ViewHelper <vhs:format.sanitizeString>

URL text segment sanitizer. Sanitizes the content into a valid URL segment value which is usable in an URL without further processing. For example, the text "I am Mr. Brown, how are you?" becomes "i-am-mr-brown-how-are-you". Special characters like diacritics or umlauts are transliterated. The built-in character map can be overriden or extended by providing an associative array of custom mappings.

Also useful when creating anchor link names, for example for news entries in your custom EXT:news list template, in which case each news item's title would become an anchor:

<a name="{newsItem.title -> v:format.url.sanitizeString()}"></a>

And links would look much like the detail view links:

/news/#this-is-a-newsitem-title

When used with list views it has the added benefit of not breaking if the item referenced is removed, it can be read by Javascript (for example to dynamically expand the news item being referenced). The sanitized urls are also ideal to use for AJAX based detail views - and in almot all cases the sanitized string will be 100% identical to the one used by Realurl when translating using table lookups.

Arguments

string

DataType
string
Required
false
Description
The string to sanitize.

customMap

DataType
mixed
Required
false
Description
Associative array of additional characters to replace or use to override built-in mappings.

format.substring ViewHelper <vhs:format.substring>

Gets a substring from a string or string-compatible value.

Also see the <f:format.crop> view helper.

Arguments

content

DataType
string
Required
false
Description
Content string to substring

start

DataType
integer
Required
false
Description
Positive or negative offset

length

DataType
integer
Required
false
Description
Positive or negative length

format.tidy ViewHelper <vhs:format.tidy>

Tidy-processes a string (HTML source), applying proper indentation.

Arguments

content

DataType
string
Required
false
Description
Content to tidy

encoding

DataType
string
Default
'utf8'
Required
false
Description
Encoding of string

format.trim ViewHelper <vhs:format.trim>

Trims $content by stripping off $characters (string list of individual chars to strip off, default is all whitespaces).

Arguments

content

DataType
string
Required
false
Description
String to trim

characters

DataType
string
Required
false
Description
List of characters to trim, no separators, e.g. "abc123"

format.wordWrap ViewHelper <vhs:format.wordWrap>

Wordwrap: Wrap a string at provided character count

Wraps a string to $limit characters and at $break character while maintaining complete words. Concatenates the resulting strings with $glue. Code is heavily inspired by Codeigniter's word_wrap helper.

Arguments

subject

DataType
string
Required
false
Description
Text to wrap

limit

DataType
integer
Default
80
Required
false
Description
Maximum length of resulting parts after wrapping

break

DataType
string
Required
false
Description
Character to wrap text at

glue

DataType
string
Required
false
Description
Character to concatenate parts with after wrapping

format.json.decode ViewHelper <vhs:format.json.decode>

Converts the JSON encoded argument into a PHP variable.

Arguments

json

DataType
string
Required
false
Description
JSON string to decode

format.json.encode ViewHelper <vhs:format.json.encode>

JSON Encoding ViewHelper

Returns a string containing the JSON representation of the argument. The argument may be any of the following types:

  • arrays, associative and traditional
  • DomainObjects
  • arrays containing DomainObjects
  • ObjectStorage containing DomainObjects
  • standard types (string, integer, boolean, float, NULL)
  • DateTime including ones found as property values on DomainObjects

Recursion protection is enabled for DomainObjects with the option to add a special marker (any variable type above also supported here) which is inserted where an object which would cause recursion would be placed.

Be specially careful when you JSON encode DomainObjects which have recursive relations to itself using either 1:n or m:n - in this case the one member of the converted relation will be whichever value you specified as "recursionMarker" - or the default value, NULL. When using the output of such conversion in JavaScript please make sure you check the type before assuming that every member of a converted 1:n or m:n recursive relation is in fact a JavaScript. Not doing so may result in fatal JavaScript errors in the client browser.

Arguments

value

DataType
mixed
Required
false
Description
Value to encode as JSON

useTraversableKeys

DataType
boolean
Required
false
Description
If TRUE, preserves keys from Traversables converted to arrays. Not recommended for ObjectStorages!

preventRecursion

DataType
boolean
Default
true
Required
false
Description
If FALSE, allows recursion to occur which could potentially be fatal to the output unless managed

recursionMarker

DataType
mixed
Required
false
Description
String or null - inserted instead of recursive instances of objects

dateTimeFormat

DataType
string
Required
false
Description
A date() format for DateTime values to JSON-compatible values. NULL means JS UNIXTIME (time()*1000)

pretty

DataType
boolean
Required
false
Description
If TRUE, outputs JSON with JSON_PRETTY_PRINT

format.placeholder.image ViewHelper <vhs:format.placeholder.image>

Placeholder Image ViewHelper

Inserts a placeholder image from http://placehold.it

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

text

DataType
string
Required
false
Description
Text to render as image

width

DataType
integer
Default
640
Required
false
Description
Width of rendered placeholder image

height

DataType
integer
Required
false
Description
Height of rendered placeholder image

backgroundColor

DataType
string
Default
'333333'
Required
false
Description
Background color

textColor

DataType
string
Default
'FFFFFF'
Required
false
Description
Text color

format.placeholder.lipsum ViewHelper <vhs:format.placeholder.lipsum>

Lipsum ViewHelper

Renders Lorem Ipsum text according to provided arguments.

Arguments

lipsum

DataType
string
Required
false
Description
Optional, custom lipsum source

paragraphs

DataType
integer
Required
false
Description
Number of paragraphs to output

wordsPerParagraph

DataType
integer
Required
false
Description
Number of words per paragraph

skew

DataType
integer
Required
false
Description
Amount in number of words to vary the number of words per paragraph

html

DataType
boolean
Required
false
Description
If TRUE, renders output as HTML paragraph tags in the same way an RTE would

parseFuncTSPath

DataType
string
Required
false
Description
If you want another parseFunc for HTML processing, enter the TS path here

format.url.decode ViewHelper <vhs:format.url.decode>

Urldecodes the provided string.

Arguments

content

DataType
string
Required
false
Description
Content to decode from URI

format.url.encode ViewHelper <vhs:format.url.encode>

Urlencodes the provided string

Arguments

content

DataType
string
Required
false
Description
Content to encode for URI

iterator.chunk ViewHelper <vhs:iterator.chunk>

Creates chunks from an input Array/Traversable with option to allocate items to a fixed number of chunks

Arguments

subject

DataType
mixed
Required
false
Description
The subject Traversable/Array instance to shift

count

DataType
integer
Required
true
Description
Number of items/chunk or if fixed then number of chunks

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

fixed

DataType
boolean
Required
false
Description
If true, creates $count chunks instead of $count values per chunk

preserveKeys

DataType
boolean
Required
false
Description
If set to true, the original array keys will be preserved

iterator.column ViewHelper <vhs:iterator.column>

Iterator Column Extraction ViewHelper

Implementation of array_column for Fluid.

Accepts an input iterator/array and creates a new array using values from one column and optionally keys from another column.

Usage examples

<!-- Given input array of user data arrays with "name" and "uid" column: -->
<f:for each="{users -> v:iterator.column(columnKey: 'name', indexKey: 'uid')}" as="username" key="uid">
    User {username} has UID {uid}.
</f:for>
Copied!

The above demonstrates the logic of the ViewHelper, but the example itself of course gives the same result as just iterating the users variable itself and outputting {user.username} etc., but the real power of the ViewHelper comes when using it to feed other ViewHelpers with data sets:

<!--
Given same input array as above. Idea being that *any* iterator
can be supported as input for "options".
-->
Select user: <f:form.select options="{users -> v:iterator.column(columnKey: 'name', indexKey: 'uid')}" />
Copied!
<!-- Given same input array as above. Idea being to output all user UIDs as CSV -->
All UIDs: {users -> v:iterator.column(columnKey: 'uid') -> v:iterator.implode()}
Copied!
<!-- Given same input array as above. Idea being to output all unique users' countries as a list: -->
Our users live in the following countries:
{users -> v:iterator.column(columnKey: 'countryName')
    -> v:iterator.unique()
    -> v:iterator.implode(glue: ' - ')}
Copied!

Note that the ViewHelper also supports the "as" argument which allows you to not return the new array but instead assign it as a new template variable - like any other "as"-capable ViewHelper.

Caveat

This ViewHelper passes the subject directly to array_column and as such it does not support dotted paths in either key argument to extract sub-properties. That means it does not support Extbase enties as input unless you explicitly implemented `ArrayAccess` on the model of the entity and even then support is limited to first level properties' values without dots in their names.

Arguments

subject

DataType
mixed
Required
false
Description
Input to work on - Array/Traversable/...

columnKey

DataType
string
Required
false
Description
Name of the column whose values will become the value of the new array

indexKey

DataType
string
Required
false
Description
Name of the column whose values will become the index of the new array

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.diff ViewHelper <vhs:iterator.diff>

Computes the difference of arrays.

Arguments

a -

DataType
mixed
Required
false
Description
First Array/Traversable/CSV

b -

DataType
mixed
Required
true
Description
Second Array/Traversable/CSV

iterator.explode ViewHelper <vhs:iterator.explode>

Explode ViewHelper

Explodes a string by $glue.

Arguments

content

DataType
string
Required
false
Description
String to be exploded by glue

glue

DataType
string
Default
','
Required
false
Description
String "glue" that separates values. If you need a constant (like PHP_EOL), use v:const to read it.

limit

DataType
mixed
Default
9223372036854775807
Required
false
Description
If limit is set and positive, the returned array will contain a maximum of limit elements with the last element containing the rest of string. If the limit parameter is negative, all components except the last-limit are returned. If the limit parameter is zero, then this is treated as 1.

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.extract ViewHelper <vhs:iterator.extract>

Iterator / Extract VieWHelper

Loop through the iterator and extract a key, optionally join the results if more than one value is found.

Extract values from an array by key

The extbase version of indexed_search returns an array of the previous search, which cannot easily be shown in the input field of the result page. This can be solved.

Example

<f:form.textfield name="search[sword]"
    value="{v:iterator.extract(key:'sword', content: searchWords) -> v:iterator.implode(glue: ' ')}"
    class="tx-indexedsearch-searchbox-sword" />
Copied!

Get the names of several users

Provided we have a bunch of FrontendUsers and we need to show their firstname combined into a string:

<h2>Welcome
<v:iterator.implode glue=", "><v:iterator.extract key="firstname" content="frontendUsers" /></v:iterator.implode>
<!-- alternative: -->
{frontendUsers -> v:iterator.extract(key: 'firstname') -> v:iterator.implode(glue: ', ')}
</h2>
Copied!

Output

<h2>Welcome Peter, Paul, Marry</h2>
Copied!

Complex example

{anArray->v:iterator.extract(path: 'childProperty.secondNestedChildObject')
    -> v:iterator.sort(direction: 'DESC', sortBy: 'propertyOnSecondChild')
    -> v:iterator.slice(length: 10)->v:iterator.extract(key: 'uid')}
Copied!

Single return value

Outputs the "uid" value of the first record in variable $someRecords without caring if there are more than one records. Always extracts the first value and then stops. Equivalent of changing -> v:iterator.first().

{someRecords -> v:iterator.extract(key: 'uid', single: TRUE)}

Copied!

Arguments

content

DataType
mixed
Required
false
Description
The array or Iterator that contains either the value or arrays of values

key

DataType
string
Required
true
Description
The name of the key from which you wish to extract the value

recursive

DataType
boolean
Default
true
Required
false
Description
If TRUE, attempts to extract the key from deep nested arrays

single

DataType
boolean
Required
false
Description
If TRUE, returns only one value - always the first one - instead of an array of values

iterator.filter ViewHelper <vhs:iterator.filter>

Iterator: Filter ViewHelper

Filters an array by filtering the array, analysing each member and asserting if it is equal to (weak type) the filter parameter. If propertyName is set, the ViewHelper will try to extract this property from each member of the array.

Iterators and ObjectStorage etc. are supported.

Arguments

subject

DataType
mixed
Required
false
Description
The subject iterator/array to be filtered

filter

DataType
mixed
Required
false
Description
The comparison value

propertyName

DataType
string
Required
false
Description
Optional property name to extract and use for comparison instead of the object; use on ObjectStorage etc. Note: supports dot-path expressions

preserveKeys

DataType
boolean
Required
false
Description
If TRUE, keys in the array are preserved - even if they are numeric

invert

DataType
boolean
Required
false
Description
Invert the behavior of the filtering

nullFilter

DataType
boolean
Required
false
Description
If TRUE and $filter is NULL (not set) includes only NULL values. Useful with $invert.

iterator.first ViewHelper <vhs:iterator.first>

Returns the first element of $haystack.

Arguments

haystack

DataType
mixed
Required
false
Description
Haystack in which to look for needle

iterator.for ViewHelper <vhs:iterator.for>

Repeats rendering of children with a typical for loop: starting at index $from it will loop until the index has reached $to.

Arguments

iteration

DataType
string
Required
false
Description
Variable name to insert result into, suppresses output

to

DataType
integer
Required
true
Description
Number that the index needs to reach before stopping

from

DataType
integer
Required
false
Description
Starting number for the index

step

DataType
integer
Default
1
Required
false
Description
Stepping number that the index is increased by after each loop

iterator.implode ViewHelper <vhs:iterator.implode>

Implode ViewHelper

Implodes an array or array-convertible object by $glue.

Arguments

content

DataType
mixed
Required
false
Description
Array or array-convertible object to be imploded by glue

glue

DataType
string
Default
','
Required
false
Description
String used as glue in the string to be exploded. To read a constant (like PHP_EOL) use v:const.

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.indexOf ViewHelper <vhs:iterator.indexOf>

Searches $haystack for index of $needle, returns -1 if $needle is not in $haystack.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

needle

DataType
mixed
Required
true
Description
Needle to search for in haystack

haystack

DataType
mixed
Required
true
Description
Haystack in which to look for needle

considerKeys

DataType
boolean
Required
false
Description
Tell whether to consider keys in the search assuming haystack is an array.

iterator.intersect ViewHelper <vhs:iterator.intersect>

Intersects arrays/Traversables $a and $b into an array.

Arguments

a -

DataType
mixed
Required
false
Description
First Array/Traversable/CSV

b -

DataType
mixed
Required
true
Description
Second Array/Traversable/CSV

iterator.keys ViewHelper <vhs:iterator.keys>

Gets keys from an iterator.

Arguments

subject

DataType
mixed
Required
false
Description
Input to work on - Array/Traversable/...

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.last ViewHelper <vhs:iterator.last>

Returns the last element of $haystack.

Arguments

haystack

DataType
mixed
Required
false
Description
Haystack in which to look for needle

iterator.loop ViewHelper <vhs:iterator.loop>

Repeats rendering of children $count times while updating $iteration.

Arguments

iteration

DataType
string
Required
false
Description
Variable name to insert result into, suppresses output

count

DataType
integer
Required
true
Description
Number of times to render child content

minimum

DataType
integer
Required
false
Description
Minimum number of loops before stopping

maximum

DataType
integer
Default
9223372036854775807
Required
false
Description
Maxiumum number of loops before stopping

iterator.merge ViewHelper <vhs:iterator.merge>

Merges arrays/Traversables $a and $b into an array.

Arguments

a -

DataType
mixed
Required
false
Description
First array/Traversable - if not set, the ViewHelper can be in a chain (inline-notation)

b -

DataType
mixed
Required
false
Description
Second array or Traversable

useKeys

DataType
boolean
Required
false
Description
If TRUE comparison is done while also observing and merging the keys used in each array

iterator.next ViewHelper <vhs:iterator.next>

Returns next element in array $haystack from position of $needle.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

needle

DataType
mixed
Required
true
Description
Needle to search for in haystack

haystack

DataType
mixed
Required
true
Description
Haystack in which to look for needle

considerKeys

DataType
boolean
Required
false
Description
Tell whether to consider keys in the search assuming haystack is an array.

iterator.pop ViewHelper <vhs:iterator.pop>

Pops the last value off $subject (but does not change $subject itself as array_pop would).

Arguments

subject

DataType
mixed
Required
false
Description
Input to work on - Array/Traversable/...

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.previous ViewHelper <vhs:iterator.previous>

Returns previous element in array $haystack from position of $needle.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

needle

DataType
mixed
Required
true
Description
Needle to search for in haystack

haystack

DataType
mixed
Required
true
Description
Haystack in which to look for needle

considerKeys

DataType
boolean
Required
false
Description
Tell whether to consider keys in the search assuming haystack is an array.

iterator.push ViewHelper <vhs:iterator.push>

Adds one variable to the end of the array and returns the result.

Example:

<f:for each="{array -> v:iterator.push(add: additionalObject, key: 'newkey')}" as="combined">
...
</f:for>

Copied!

Arguments

subject

DataType
mixed
Required
false
Description
Input to work on - Array/Traversable/...

add

DataType
mixed
Required
true
Description
Member to add to end of array

key

DataType
mixed
Required
false
Description
Optional key to use. If key exists the member will be overwritten!

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.random ViewHelper <vhs:iterator.random>

Returns random element from array.

Arguments

subject

DataType
mixed
Required
false
Description
The subject Traversable/Array instance from which to select a random element

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.range ViewHelper <vhs:iterator.range>

Iterator Range ViewHelper

Implementation of range for Fluid

Creates a new array of numbers from the low to the high given value, incremented by the step value.

Usage examples

Numbers 1-10: {v:iterator.implode(glue: ',') -> v:iterator.range(low: 1, high: 10)}
Even numbers 0-10: {v:iterator.implode(glue: ',') -> v:iterator.range(low: 0, high: 10, step: 2)}

Copied!

Arguments

low

DataType
integer
Default
1
Required
false
Description
The low number of the range to be generated

high

DataType
integer
Required
true
Description
The high number of the range to be generated

step

DataType
integer
Default
1
Required
false
Description
The step (increment amount) between each number

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.reverse ViewHelper <vhs:iterator.reverse>

Iterator Reversal ViewHelper

Reverses the order of every member of an Iterator/Array, preserving the original keys.

Arguments

subject

DataType
mixed
Required
false
Description
The input array/Traversable to reverse

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.shift ViewHelper <vhs:iterator.shift>

Shifts the first value off $subject (but does not change $subject itself as array_shift would).

Arguments

subject

DataType
mixed
Required
false
Description
The input array/Traversable to shift

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.slice ViewHelper <vhs:iterator.slice>

Slice an Iterator by $start and $length.

Arguments

haystack

DataType
mixed
Required
false
Description
The input array/Traversable to reverse

start

DataType
integer
Required
false
Description
Starting offset

length

DataType
integer
Required
false
Description
Number of items to slice

preserveKeys

DataType
boolean
Default
true
Required
false
Description
Whether or not to preserve original keys

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.sort ViewHelper <vhs:iterator.sort>

Sorts an instance of ObjectStorage, an Iterator implementation, an Array or a QueryResult (including Lazy counterparts).

Can be used inline, i.e.:

<f:for each="{dataset -> v:iterator.sort(sortBy: 'name')}" as="item">
    // iterating data which is ONLY sorted while rendering this particular loop
</f:for>

Copied!

Arguments

subject

DataType
mixed
Required
false
Description
The array/Traversable instance to sort

sortBy

DataType
string
Required
false
Description
Which property/field to sort by - leave out for numeric sorting based on indexes(keys)

order

DataType
string
Default
'ASC'
Required
false
Description
ASC, DESC, RAND or SHUFFLE. RAND preserves keys, SHUFFLE does not - but SHUFFLE is faster

sortFlags

DataType
string
Default
'SORT_REGULAR'
Required
false
Description
Constant name from PHP for SORT_FLAGS: SORT_REGULAR, SORT_STRING, SORT_NUMERIC, SORT_NATURAL, SORT_LOCALE_STRING or SORT_FLAG_CASE. You can provide a comma seperated list or array to use a combination of flags.

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.split ViewHelper <vhs:iterator.split>

Converts a string to an array with $length number of bytes per new array element. Wrapper for PHP's str_split.

Arguments

subject

DataType
string
Required
false
Description
The string that will be split into an array

length

DataType
integer
Default
1
Required
false
Description
Number of bytes per chunk in the new array

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.unique ViewHelper <vhs:iterator.unique>

Iterator Unique Values ViewHelper

Implementation of array_unique for Fluid

Accepts an input array of values and returns/assigns a new array containing only the unique values found in the input array.

Note that the ViewHelper does not support the sorting parameter - if you wish to sort the result you should use v:iterator.sort in a chain.

Usage examples

<!--
Given a (large) array of every user's country with possible duplicates.
The idea being to output only a unique list of countries' names.
-->

Countries of our users: {userCountries -> v:iterator.unique() -> v:iterator.implode(glue: ' - ')}
Copied!

Output:

Countries of our users: USA - USA - Denmark - Germany - Germany - USA - Denmark - Germany
Copied!
<!-- Given the same use case as above but also implementing sorting -->
Countries of our users, in alphabetical order:
{userCountries -> v:iterator.unique()
    -> v:iterator.sort(sortFlags: 'SORT_NATURAL')
    -> v:iterator.implode(glue: ' - ')}
Copied!

Output:

Countries of our users: Denmark - Germany - USA

Copied!

Arguments

subject

DataType
mixed
Required
false
Description
The input array/Traversable to process

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

iterator.values ViewHelper <vhs:iterator.values>

Gets values from an iterator, removing current keys (if any exist).

Arguments

subject

DataType
mixed
Required
false
Description
The array/Traversable instance from which to get values

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

math.average ViewHelper <vhs:math.average>

Math: Average

Performs average across an array. If $a is an array and $b is an array, each member of $a is averaged against the same member in $b. If $a is an array and $b is a number, each member of $a is averaged agained $b. If $a is an array this array is averaged to one number. If $a is a number and $b is not provided or NULL, $a is gracefully returned as an average value of itself.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

b -

DataType
mixed
Required
false
Description
Optional: Second number or Iterator/Traversable/Array for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.ceil ViewHelper <vhs:math.ceil>

Math: Ceil

Ceiling on $a which can be either an array-accessible value (Iterator+ArrayAccess || array) or a raw numeric value.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.cube ViewHelper <vhs:math.cube>

Math: Square

Performs $a ^ 3.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.cubicRoot ViewHelper <vhs:math.cubicRoot>

Math: CubicRoot

Performs pow($a, 1/3) - cubic or third root.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.division ViewHelper <vhs:math.division>

Math: Division

Performs division of $a using $b. A can be an array and $b a number, in which case each member of $a gets divided by $b. If both $a and $b are arrays, each member of $a is summed against the corresponding member in $b compared using index.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

b -

DataType
mixed
Required
true
Description
Second number or Iterator/Traversable/Array for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.floor ViewHelper <vhs:math.floor>

Math: Floor

Floors $a which can be either an array-accessible value (Iterator+ArrayAccess || array) or a raw numeric value.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.maximum ViewHelper <vhs:math.maximum>

Math: Maximum

Gets the highest number in array $a or the highest number of numbers $a and $b.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

b -

DataType
mixed
Required
false
Description
Second number or Iterator/Traversable/Array for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.median ViewHelper <vhs:math.median>

Math: Median

Gets the median value from an array of numbers. If there is an odd number of numbers the middle value is returned. If there is an even number of numbers an average of the two middle numbers is returned.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.minimum ViewHelper <vhs:math.minimum>

Math: Minimum

Gets the lowest number in array $a or the lowest number of numbers $a and $b.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

b -

DataType
mixed
Required
false
Description
Second number or Iterator/Traversable/Array for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.modulo ViewHelper <vhs:math.modulo>

Math: Modulo Perform modulo on $input. Returns the same type as $input, i.e. if given an array, will transform each member and return the result. Supports array and Iterator (in the following descriptions "array" means both these types):

If $a and $b are both arrays of the same size then modulo is performed on $a using members of $b, by their index (so these must match in both arrays).

If $a is an array and $b is a number then modulo is performed on $a using $b for each calculation.

If $a and $b are both numbers simple modulo is performed.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

b -

DataType
mixed
Required
true
Description
Second number or Iterator/Traversable/Array for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.power ViewHelper <vhs:math.power>

Math: Power

Performs pow($a, $b) where $a is the base and $b is the exponent.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

b -

DataType
mixed
Required
true
Description
Second number or Iterator/Traversable/Array for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.product ViewHelper <vhs:math.product>

Math: Product (multiplication)

Product (multiplication) of $a and $b. A can be an array and $b a number, in which case each member of $a gets multiplied by $b. If $a is an array and $b is not provided then array_product is used to return a single numeric value. If both $a and $b are arrays, each member of $a is multiplied against the corresponding member in $b compared using index.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

b -

DataType
mixed
Required
true
Description
Second number or Iterator/Traversable/Array for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.range ViewHelper <vhs:math.range>

Math: Range

Gets the lowest and highest number from an array of numbers. Returns an array of [low, high]. For individual low/high values please use v:math.maximum and v:math.minimum.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.round ViewHelper <vhs:math.round>

Math: Round

Rounds off $a which can be either an array-accessible value (Iterator+ArrayAccess || array) or a raw numeric value.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

decimals

DataType
integer
Required
false
Description
Number of decimals

math.squareRoot ViewHelper <vhs:math.squareRoot>

Math: SquareRoot

Performs sqrt($a).

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.square ViewHelper <vhs:math.square>

Math: Square

Performs $a ^ 2.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.subtract ViewHelper <vhs:math.subtract>

Math: Subtract

Performs subtraction of $a and $b. A can be an array and $b a number, in which case each member of $a gets subtracted $b. If $a is an array and $b is not provided then neg. array_sum is used to return a single numeric value. If both $a and $b are arrays, each member of $a is summed against the corresponding member in $b compared using index.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

b -

DataType
mixed
Required
false
Description
Optional: Second number or Iterator/Traversable/Array for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

math.sum ViewHelper <vhs:math.sum>

Math: Sum

Performs sum of $a and $b. A can be an array and $b a number, in which case each member of $a gets summed with $b. If $a is an array and $b is not provided then array_sum is used to return a single numeric value. If both $a and $b are arrays, each member of $a is summed against the corresponding member in $b compared using index.

Arguments

a -

DataType
mixed
Required
false
Description
First number for calculation

b -

DataType
mixed
Required
false
Description
Optional: Second number or Iterator/Traversable/Array for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument "a" is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

media.audio ViewHelper <vhs:media.audio>

Renders HTML code to embed a HTML5 audio player. NOTICE: This is all HTML5 and won't work on browsers like IE8 and below. Include some helper library like kolber.github.io/audiojs/ if you need to suport those. Source can be a single file, a CSV of files or an array of arrays with multiple sources for different audio formats. In the latter case provide array keys 'src' and 'type'. Providing an array of sources (even for a single source) is preferred as you can set the correct mime type of the audio which is otherwise guessed from the filename's extension.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

src

DataType
mixed
Required
true
Description
Path to the media resource(s). Can contain single or multiple paths for videos/audio (either CSV, array or implementing Traversable).

relative

DataType
boolean
Default
true
Required
false
Description
If FALSE media URIs are rendered absolute. URIs in backend mode are always absolute.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

forceClosingTag

DataType
boolean
Required
false
Description
If TRUE, forces the created tag to use a closing tag. If FALSE, allows self-closing tags.

hideIfEmpty

DataType
boolean
Required
false
Description
Hide the tag completely if there is no tag content

contenteditable

DataType
string
Required
false
Description
Specifies whether the contents of the element are editable.

contextmenu

DataType
string
Required
false
Description
The value of the id attribute on the menu with which to associate the element as a context menu.

draggable

DataType
string
Required
false
Description
Specifies whether the element is draggable.

dropzone

DataType
string
Required
false
Description
Specifies what types of content can be dropped on the element, and instructs the UA about which actions to take with content when it is dropped on the element.

translate

DataType
string
Required
false
Description
Specifies whether an elements attribute values and contents of its children are to be translated when the page is localized, or whether to leave them unchanged.

spellcheck

DataType
string
Required
false
Description
Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking.

hidden

DataType
string
Required
false
Description
Specifies that the element represents an element that is not yet, or is no longer, relevant.

width

DataType
integer
Required
true
Description
Sets the width of the audio player in pixels.

height

DataType
integer
Required
true
Description
Sets the height of the audio player in pixels.

autoplay

DataType
boolean
Required
false
Description
Specifies that the audio will start playing as soon as it is ready.

controls

DataType
boolean
Required
false
Description
Specifies that audio controls should be displayed (such as a play/pause button etc).

loop

DataType
boolean
Required
false
Description
Specifies that the audio will start over again, every time it is finished.

muted

DataType
boolean
Required
false
Description
Specifies that the audio output of the audio should be muted.

poster

DataType
string
Required
false
Description
Specifies an image to be shown while the audio is downloading, or until the user hits the play button.

preload

DataType
string
Default
'auto'
Required
false
Description
Specifies if and how the author thinks the audio should be loaded when the page loads. Can be "auto", "metadata" or "none".

unsupported

DataType
string
Required
false
Description
Add a message for old browsers like Internet Explorer 9 without audio support.

media.exists ViewHelper <vhs:media.exists>

File/Directory Exists Condition ViewHelper.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

file

DataType
string
Required
false
Description
Filename which must exist to trigger f:then rendering

directory

DataType
string
Required
false
Description
Directory which must exist to trigger f:then rendering

media.extension ViewHelper <vhs:media.extension>

Returns the extension of the provided file.

Arguments

file

DataType
string
Required
false
Description
Path to the file to determine extension for.

media.files ViewHelper <vhs:media.files>

Returns an array of files found in the provided path.

Arguments

path

DataType
string
Required
false
Description
Path to the folder containing the files to be listed.

extensionList

DataType
string
Required
false
Description
A comma seperated list of file extensions to pick up.

prependPath

DataType
boolean
Required
false
Description
If set to TRUE the path will be prepended to file names.

order

DataType
string
Required
false
Description
If set to "mtime" sorts files by modification time or alphabetically otherwise.

excludePattern

DataType
string
Required
false
Description
A comma seperated list of filenames to exclude, no wildcards.

media.gravatar ViewHelper <vhs:media.gravatar>

Renders Gravatar <img/> tag.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

email

DataType
string
Required
true
Description
Email address

size

DataType
integer
Required
false
Description
Size in pixels, defaults to 80px [ 1 - 2048 ]

imageSet

DataType
string
Required
false
Description
Default image set to use. Possible values [ 404 | mm | identicon | monsterid | wavatar ]

maximumRating

DataType
string
Required
false
Description
Maximum rating (inclusive) [ g | pg | r | x ]

secure

DataType
boolean
Default
true
Required
false
Description
If it is FALSE will return the un secure Gravatar domain (www.gravatar.com)

media.image ViewHelper <vhs:media.image>

Renders an image tag for the given resource including all valid HTML5 attributes. Derivates of the original image are rendered if the provided (optional) dimensions differ.

## rendering responsive Images variants

You can use the srcset argument to generate several differently sized versions of this image that will be added as a srcset argument to the img tag. enter a list of widths in the srcset to genereate copies of the same crop + ratio but in the specified widths. Put the width at the start that you want to use as a fallback to be shown when no srcset functionality is supported.

Example

<v:media.image src="fileadmin/some-image.png" srcset="480,768,992,1200" />
Copied!

Browser Support

To have the widest Browser-Support you should consider using a polyfill like: http://scottjehl.github.io/picturefill

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

src

DataType
mixed
Required
true
Description
Path to the media resource(s). Can contain single or multiple paths for videos/audio (either CSV, array or implementing Traversable).

relative

DataType
boolean
Default
true
Required
false
Description
If FALSE media URIs are rendered absolute. URIs in backend mode are always absolute.

width

DataType
string
Required
false
Description
Width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

height

DataType
string
Required
false
Description
Height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

maxW

DataType
integer
Required
false
Description
Maximum Width of the image. (no upscaling)

maxH

DataType
integer
Required
false
Description
Maximum Height of the image. (no upscaling)

minW

DataType
integer
Required
false
Description
Minimum Width of the image.

minH

DataType
integer
Required
false
Description
Minimum Height of the image.

format

DataType
string
Required
false
Description
Format of the processed file - also determines the target file format. If blank, TYPO3/IM/GM default is taken into account.

quality

DataType
integer
Default
90
Required
false
Description
Quality of the processed image. If blank/not present falls back to the default quality defined in install tool.

treatIdAsReference

DataType
boolean
Required
false
Description
When TRUE treat given src argument as sys_file_reference record. Applies only to TYPO3 6.x and above.

canvasWidth

DataType
integer
Required
false
Description
Width of an optional canvas to place the image on.

canvasHeight

DataType
integer
Required
false
Description
Height of an optional canvas to place the image on.

canvasColor

DataType
string
Required
false
Description
Background color of an optional canvas to place the image on (hex triplet).

transparencyColor

DataType
string
Required
false
Description
Color to set transparent when using canvas feature (hex triplet).

crop

DataType
string
Required
false
Description
Information generated by the backend's graphical cropping UI

graceful

DataType
boolean
Required
false
Description
Set to TRUE to ignore files that cannot be loaded. Default behavior is to throw an Exception.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

usemap

DataType
string
Required
false
Description
A hash-name reference to a map element with which to associate the image.

ismap

DataType
string
Required
false
Description
Specifies that its img element provides access to a server-side image map.

alt

DataType
string
Required
true
Description
Equivalent content for those who cannot process images or who have image loading disabled.

srcset

DataType
mixed
Required
false
Description
List of width used for the srcset variants (either CSV, array or implementing Traversable)

srcsetDefault

DataType
integer
Required
false
Description
Default width to use as a fallback for browsers that don't support srcset

media.pdfThumbnail ViewHelper <vhs:media.pdfThumbnail>

Converts the provided PDF file into a PNG thumbnail and renders the according image tag using Fluid's standard image ViewHelper thus implementing its arguments. For PDF documents with multiple pages the first page is rendered by default unless specified.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

src

DataType
mixed
Required
true
Description
Path to the media resource(s). Can contain single or multiple paths for videos/audio (either CSV, array or implementing Traversable).

relative

DataType
boolean
Default
true
Required
false
Description
If FALSE media URIs are rendered absolute. URIs in backend mode are always absolute.

width

DataType
string
Required
false
Description
Width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

height

DataType
string
Required
false
Description
Height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

maxW

DataType
integer
Required
false
Description
Maximum Width of the image. (no upscaling)

maxH

DataType
integer
Required
false
Description
Maximum Height of the image. (no upscaling)

minW

DataType
integer
Required
false
Description
Minimum Width of the image.

minH

DataType
integer
Required
false
Description
Minimum Height of the image.

format

DataType
string
Required
false
Description
Format of the processed file - also determines the target file format. If blank, TYPO3/IM/GM default is taken into account.

quality

DataType
integer
Default
90
Required
false
Description
Quality of the processed image. If blank/not present falls back to the default quality defined in install tool.

treatIdAsReference

DataType
boolean
Required
false
Description
When TRUE treat given src argument as sys_file_reference record. Applies only to TYPO3 6.x and above.

canvasWidth

DataType
integer
Required
false
Description
Width of an optional canvas to place the image on.

canvasHeight

DataType
integer
Required
false
Description
Height of an optional canvas to place the image on.

canvasColor

DataType
string
Required
false
Description
Background color of an optional canvas to place the image on (hex triplet).

transparencyColor

DataType
string
Required
false
Description
Color to set transparent when using canvas feature (hex triplet).

crop

DataType
string
Required
false
Description
Information generated by the backend's graphical cropping UI

graceful

DataType
boolean
Required
false
Description
Set to TRUE to ignore files that cannot be loaded. Default behavior is to throw an Exception.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

usemap

DataType
string
Required
false
Description
A hash-name reference to a map element with which to associate the image.

ismap

DataType
string
Required
false
Description
Specifies that its img element provides access to a server-side image map.

alt

DataType
string
Required
true
Description
Equivalent content for those who cannot process images or who have image loading disabled.

srcset

DataType
mixed
Required
false
Description
List of width used for the srcset variants (either CSV, array or implementing Traversable)

srcsetDefault

DataType
integer
Required
false
Description
Default width to use as a fallback for browsers that don't support srcset

path

DataType
string
Required
false
Description
DEPRECATED: Use src instead

minWidth

DataType
integer
Required
false
Description
DEPRECATED: Use minW instead

minHeight

DataType
integer
Required
false
Description
DEPRECATED: Use minH instead

maxWidth

DataType
integer
Required
false
Description
DEPRECATED: Use maxW instead

maxHeight

DataType
integer
Required
false
Description
DEPRECATED: Use maxH instead

density

DataType
integer
Default
100
Required
false
Description
Canvas resolution for rendering the PDF in dpi (higher means better quality)

background

DataType
string
Required
false
Description
Fill background of resulting image with this color (for transparent source files)

rotate

DataType
integer
Required
false
Description
Number of degress to rotate resulting image by (caution: very slow if not multiple of 90)

page

DataType
integer
Default
1
Required
false
Description
Optional page number to render as thumbnail for PDF documents with multiple pages

forceOverwrite

DataType
boolean
Required
false
Description
Forcibly overwrite existing converted PDF files

media.picture ViewHelper <vhs:media.picture>

Renders a picture element with different images/sources for specific media breakpoints

Example

<v:media.picture src="fileadmin/some-image.png" alt="Some Image" loading="lazy">
    <v:media.source media="(min-width: 1200px)" width="500c" height="500c" />
    <v:media.source media="(min-width: 992px)" width="300c" height="300c" />
    <v:media.source media="(min-width: 768px)" width="200c" height="200c" />
    <v:media.source width="80c" height="80c" />
</v:media.picture>
Copied!

Browser Support

To have the widest Browser-Support you should consider using a polyfill like: http://scottjehl.github.io/picturefill

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

src

DataType
mixed
Required
true
Description
Path to the image or FileReference.

treatIdAsReference

DataType
boolean
Required
false
Description
When TRUE treat given src argument as sys_file_reference record.

alt

DataType
string
Required
true
Description
Text for the alt attribute.

title

DataType
string
Required
false
Description
Text for the title attribute.

class

DataType
string
Required
false
Description
CSS class(es) to set.

loading

DataType
string
Required
false
Description
Native lazy-loading for images. Can be "lazy", "eager" or "auto"

media.size ViewHelper <vhs:media.size>

Returns the size of the provided file in bytes.

Arguments

path

DataType
string
Required
false
Description
Path to the file to determine size for.

media.source ViewHelper <vhs:media.source>

Used in conjuntion with the v:media.PictureViewHelper. Please take a look at the v:media.PictureViewHelper documentation for more information.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

media

DataType
string
Required
false
Description
Media query for which breakpoint this sources applies

width

DataType
string
Required
false
Description
Width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

height

DataType
string
Required
false
Description
Height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

maxW

DataType
integer
Required
false
Description
Maximum Width of the image. (no upscaling)

maxH

DataType
integer
Required
false
Description
Maximum Height of the image. (no upscaling)

minW

DataType
integer
Required
false
Description
Minimum Width of the image.

minH

DataType
integer
Required
false
Description
Minimum Height of the image.

format

DataType
string
Required
false
Description
Format of the processed file - also determines the target file format. If blank, TYPO3/IM/GM default is taken into account.

quality

DataType
integer
Default
90
Required
false
Description
Quality of the processed image. If blank/not present falls back to the default quality defined in install tool.

relative

DataType
boolean
Required
false
Description
Produce a relative URL instead of absolute

media.spotify ViewHelper <vhs:media.spotify>

Renders HTML code to embed a Spotify play button.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

spotifyUri

DataType
string
Required
true
Description
Spotify URI to create the play button for. Right click any song, album or playlist in Spotify and select Copy Spotify URI.

width

DataType
mixed
Default
300
Required
false
Description
Width of the play button in pixels. Defaults to 300

height

DataType
mixed
Default
380
Required
false
Description
Height of the play button in pixels. Defaults to 380

compact

DataType
boolean
Required
false
Description
Whether to render the compact button with a fixed height of 80px.

theme

DataType
string
Default
'black'
Required
false
Description
Theme to use. Can be "black" or "white" and is not available in compact mode. Defaults to "black".

view

DataType
string
Default
'list'
Required
false
Description
View to use. Can be "list" or "coverart" and is not available in compact mode. Defaults to "list".

media.video ViewHelper <vhs:media.video>

Renders HTML code to embed a HTML5 video player. NOTICE: This is all HTML5 and won't work on browsers like IE8 and below. Include some helper library like videojs.com if you need to suport those. Source can be a single file, a CSV of files or an array of arrays with multiple sources for different video formats. In the latter case provide array keys 'src' and 'type'. Providing an array of sources (even for a single source) is preferred as you can set the correct mime type of the video which is otherwise guessed from the filename's extension.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

src

DataType
mixed
Required
true
Description
Path to the media resource(s). Can contain single or multiple paths for videos/audio (either CSV, array or implementing Traversable).

relative

DataType
boolean
Default
true
Required
false
Description
If FALSE media URIs are rendered absolute. URIs in backend mode are always absolute.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

forceClosingTag

DataType
boolean
Required
false
Description
If TRUE, forces the created tag to use a closing tag. If FALSE, allows self-closing tags.

hideIfEmpty

DataType
boolean
Required
false
Description
Hide the tag completely if there is no tag content

contenteditable

DataType
string
Required
false
Description
Specifies whether the contents of the element are editable.

contextmenu

DataType
string
Required
false
Description
The value of the id attribute on the menu with which to associate the element as a context menu.

draggable

DataType
string
Required
false
Description
Specifies whether the element is draggable.

dropzone

DataType
string
Required
false
Description
Specifies what types of content can be dropped on the element, and instructs the UA about which actions to take with content when it is dropped on the element.

translate

DataType
string
Required
false
Description
Specifies whether an elements attribute values and contents of its children are to be translated when the page is localized, or whether to leave them unchanged.

spellcheck

DataType
string
Required
false
Description
Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking.

hidden

DataType
string
Required
false
Description
Specifies that the element represents an element that is not yet, or is no longer, relevant.

width

DataType
integer
Required
true
Description
Sets the width of the video player in pixels.

height

DataType
integer
Required
true
Description
Sets the height of the video player in pixels.

autoplay

DataType
boolean
Required
false
Description
Specifies that the video will start playing as soon as it is ready.

controls

DataType
boolean
Required
false
Description
Specifies that video controls should be displayed (such as a play/pause button etc).

loop

DataType
boolean
Required
false
Description
Specifies that the video will start over again, every time it is finished.

muted

DataType
boolean
Required
false
Description
Specifies that the audio output of the video should be muted.

poster

DataType
string
Required
false
Description
Specifies an image to be shown while the video is downloading, or until the user hits the play button.

preload

DataType
string
Default
'auto'
Required
false
Description
Specifies if and how the author thinks the video should be loaded when the page loads. Can be "auto", "metadata" or "none".

unsupported

DataType
string
Required
false
Description
Add a message for old browsers like Internet Explorer 9 without video support.

media.vimeo ViewHelper <vhs:media.vimeo>

Renders HTML code to embed a video from Vimeo.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
boolean
Default
true
Required
false
Description
Show the title on the video. Defaults to TRUE.

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

videoId

DataType
string
Required
true
Description
Vimeo ID of the video to embed.

width

DataType
integer
Default
640
Required
false
Description
Width of the video in pixels. Defaults to 640 for 16:9 content.

height

DataType
integer
Default
360
Required
false
Description
Height of the video in pixels. Defaults to 360 for 16:9 content.

byline

DataType
boolean
Default
true
Required
false
Description
Show the users byline on the video. Defaults to TRUE.

portrait

DataType
boolean
Default
true
Required
false
Description
Show the users portrait on the video. Defaults to TRUE.

color

DataType
string
Default
'00adef'
Required
false
Description
Specify the color of the video controls. Defaults to 00adef. Make sure that you dont include the #.

autoplay

DataType
boolean
Required
false
Description
Play the video automatically on load. Defaults to FALSE. Note that this wont work on some devices.

loop

DataType
boolean
Required
false
Description
Play the video again when it reaches the end. Defaults to FALSE.

api

DataType
boolean
Required
false
Description
Set to TRUE to enable the Javascript API.

playerId

DataType
string
Required
false
Description
An unique id for the player that will be passed back with all Javascript API responses.

media.youtube ViewHelper <vhs:media.youtube>

Renders HTML code to embed a video from YouTube.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

videoId

DataType
string
Required
true
Description
YouTube id of the video to embed.

width

DataType
integer
Default
640
Required
false
Description
Width of the video in pixels. Defaults to 640 for 16:9 content.

height

DataType
integer
Default
385
Required
false
Description
Height of the video in pixels. Defaults to 385 for 16:9 content.

autoplay

DataType
boolean
Required
false
Description
Play the video automatically on load. Defaults to FALSE.

legacyCode

DataType
boolean
Required
false
Description
Whether to use the legacy flash video code.

showRelated

DataType
boolean
Required
false
Description
Whether to show related videos after playing.

extendedPrivacy

DataType
boolean
Default
true
Required
false
Description
Whether to use cookie-less video player.

hideControl

DataType
boolean
Required
false
Description
Hide video player's control bar.

hideInfo

DataType
boolean
Required
false
Description
Hide video player's info bar.

enableJsApi

DataType
boolean
Required
false
Description
Enable YouTube JavaScript API

playlist

DataType
string
Required
false
Description
Comma seperated list of video IDs to be played.

loop

DataType
boolean
Required
false
Description
Play the video in a loop.

start

DataType
integer
Required
false
Description
Start playing after seconds.

end

DataType
integer
Required
false
Description
Stop playing after seconds.

lightTheme

DataType
boolean
Required
false
Description
Use the YouTube player's light theme.

videoQuality

DataType
string
Required
false
Description
Set the YouTube player's video quality (hd1080,hd720,highres,large,medium,small).

windowMode

DataType
string
Required
false
Description
Set the Window-Mode of the YouTube player (transparent,opaque). This is necessary for z-index handling in IE10/11.

media.image.height ViewHelper <vhs:media.image.height>

Returns the height of the provided image file in pixels.

Arguments

src

DataType
mixed
Required
true
Description
Path to or id of the image file to determine info for. In case a FileReference is supplied, treatIdAsUid and treatIdAsReference will automatically be activated.

treatIdAsUid

DataType
boolean
Required
false
Description
If TRUE, the path argument is treated as a resource uid.

treatIdAsReference

DataType
boolean
Required
false
Description
If TRUE, the path argument is treated as a reference uid and will be resolved to a resource via sys_file_reference.

media.image.mimetype ViewHelper <vhs:media.image.mimetype>

Returns the mimetype of the provided image file.

Arguments

src

DataType
mixed
Required
true
Description
Path to or id of the image file to determine info for. In case a FileReference is supplied, treatIdAsUid and treatIdAsReference will automatically be activated.

treatIdAsUid

DataType
boolean
Required
false
Description
If TRUE, the path argument is treated as a resource uid.

treatIdAsReference

DataType
boolean
Required
false
Description
If TRUE, the path argument is treated as a reference uid and will be resolved to a resource via sys_file_reference.

media.image.width ViewHelper <vhs:media.image.width>

Returns the width of the provided image file in pixels.

Arguments

src

DataType
mixed
Required
true
Description
Path to or id of the image file to determine info for. In case a FileReference is supplied, treatIdAsUid and treatIdAsReference will automatically be activated.

treatIdAsUid

DataType
boolean
Required
false
Description
If TRUE, the path argument is treated as a resource uid.

treatIdAsReference

DataType
boolean
Required
false
Description
If TRUE, the path argument is treated as a reference uid and will be resolved to a resource via sys_file_reference.

once.instance ViewHelper <vhs:once.instance>

Once: Instance

Displays nested content or "then" child once per instance of the content element or plugin being rendered, as identified by the contentObject UID (or globally if no contentObject is associated).

"Once"-style ViewHelpers are purposed to only display their nested content once per XYZ, where the XYZ depends on the specific type of ViewHelper (session, cookie etc).

In addition the ViewHelper is a ConditionViewHelper, which means you can utilize the f:then and f:else child nodes as well as the "then" and "else" arguments.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

identifier

DataType
string
Required
false
Description
Identity of this condition - if used in other places, the condition applies to the same identity in the storage (i.e. cookie name or session key)

lockToDomain

DataType
boolean
Required
false
Description
If TRUE, locks this condition to a specific domain, i.e. the storage of $identity is associated with a domain. If same identity is also used without domain lock, it matches any domain locked condition

ttl

DataType
integer
Default
86400
Required
false
Description
Time-to-live for skip registration, number of seconds. After this expires the registration is unset

once.session ViewHelper <vhs:once.session>

Once: Session

Displays nested content or "then" child once per session.

"Once"-style ViewHelpers are purposed to only display their nested content once per XYZ, where the XYZ depends on the specific type of ViewHelper (session, cookie etc).

In addition the ViewHelper is a ConditionViewHelper, which means you can utilize the f:then and f:else child nodes as well as the "then" and "else" arguments.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

identifier

DataType
string
Required
false
Description
Identity of this condition - if used in other places, the condition applies to the same identity in the storage (i.e. cookie name or session key)

lockToDomain

DataType
boolean
Required
false
Description
If TRUE, locks this condition to a specific domain, i.e. the storage of $identity is associated with a domain. If same identity is also used without domain lock, it matches any domain locked condition

ttl

DataType
integer
Default
86400
Required
false
Description
Time-to-live for skip registration, number of seconds. After this expires the registration is unset

once.standard ViewHelper <vhs:once.standard>

Once: Standard

Displays nested content or "then" child once per rendering stack - i.e. per Layout, or Template if no Layout is used.

"Once"-style ViewHelpers are purposed to only display their nested content once per XYZ, where the XYZ depends on the specific type of ViewHelper (session, cookie etc).

In addition the ViewHelper is a ConditionViewHelper, which means you can utilize the f:then and f:else child nodes as well as the "then" and "else" arguments.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

identifier

DataType
string
Required
false
Description
Identity of this condition - if used in other places, the condition applies to the same identity in the storage (i.e. cookie name or session key)

lockToDomain

DataType
boolean
Required
false
Description
If TRUE, locks this condition to a specific domain, i.e. the storage of $identity is associated with a domain. If same identity is also used without domain lock, it matches any domain locked condition

ttl

DataType
integer
Default
86400
Required
false
Description
Time-to-live for skip registration, number of seconds. After this expires the registration is unset

page.absoluteUrl ViewHelper <vhs:page.absoluteUrl>

Returns a full, absolute URL to this page with all arguments.

Arguments

This ViewHelper has no arguments.

page.header ViewHelper <vhs:page.header>

ViewHelper used to place header blocks in document header

Arguments

content

DataType
string
Required
false
Description
Content to insert in header/footer

path

DataType
string
Required
false
Description
If not using tag content, specify path to file here

external

DataType
boolean
Required
false
Description
If TRUE and standalone, includes the file as raw URL. If TRUE and not standalone then downloads the file and merges it when building Assets

name

DataType
string
Required
false
Description
Optional name of the content. If multiple occurrences of the same name happens, behavior is defined by argument "overwrite"

overwrite

DataType
boolean
Default
true
Required
false
Description
If set to FALSE and a relocated string with "name" already exists, does not overwrite the existing relocated string. Default behavior is to overwrite.

dependencies

DataType
string
Required
false
Description
CSV list of other named assets upon which this asset depends. When included, this asset will always load after its dependencies

group

DataType
string
Default
'fluid'
Required
false
Description
Optional name of a logical group (created dynamically just by using the name) to which this particular asset belongs.

debug

DataType
boolean
Required
false
Description
If TRUE, outputs information about this ViewHelper when the tag is used. Two master debug switches exist in TypoScript; see documentation about Page / Asset ViewHelper

standalone

DataType
boolean
Required
false
Description
If TRUE, excludes this Asset from any concatenation which may be applied

rewrite

DataType
boolean
Default
true
Required
false
Description
If FALSE, this Asset will be included as is without any processing of contained urls

fluid

DataType
boolean
Required
false
Description
If TRUE, renders this (standalone or external) Asset as if it were a Fluid template, passing along values of the "variables" attribute or every available template variable if "variables" not specified

variables

DataType
mixed
Required
false
Description
An optional array of arguments which you use inside the Asset, be it standalone or inline. Use this argument to ensure your Asset filenames are only reused when all variables used in the Asset are the same

movable

DataType
boolean
Default
true
Required
false
Description
If TRUE, allows this Asset to be included in the document footer rather than the header. Should never be allowed for CSS.

trim

DataType
boolean
Required
false
Description
DEPRECATED. Trim is no longer supported. Setting this to TRUE doesn't do anything.

namedChunks

DataType
boolean
Required
false
Description
If FALSE, hides the comment containing the name of each of Assets which is merged in a merged file. Disable to avoid a bit more output at the cost of transparency

page.info ViewHelper <vhs:page.info>

ViewHelper to access data of the current page record.

Does not work in the TYPO3 backend.

Arguments

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

pageUid

DataType
integer
Required
false
Description
If specified, this UID will be used to fetch page data instead of using the current page.

field

DataType
string
Required
false
Description
If specified, only this field will be returned/assigned instead of the complete page record.

page.languageMenu ViewHelper <vhs:page.languageMenu>

ViewHelper for rendering TYPO3 menus in Fluid Require the extension static_info_table.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

tagName

DataType
string
Default
'ul'
Required
false
Description
Tag name to use for enclosing container, list and flags (not finished) only

tagNameChildren

DataType
string
Default
'li'
Required
false
Description
Tag name to use for child nodes surrounding links, list and flags only

defaultIsoFlag

DataType
string
Required
false
Description
ISO code of the default flag

defaultLanguageLabel

DataType
string
Required
false
Description
Label for the default language

order

DataType
mixed
Required
false
Description
Orders the languageIds after this list

labelOverwrite

DataType
mixed
Required
false
Description
Overrides language labels

hideNotTranslated

DataType
boolean
Required
false
Description
Hides languageIDs which are not translated

layout

DataType
string
Default
'flag,name'
Required
false
Description
How to render links when using autorendering. Possible selections: name,flag - use fx "name" or "flag,name" or "name,flag"

useCHash

DataType
boolean
Default
true
Required
false
Description
Use cHash for typolink. Has no effect on TYPO3 v9.5+

flagPath

DataType
string
Required
false
Description
Overwrites the path to the flag folder

flagImageType

DataType
string
Default
'svg'
Required
false
Description
Sets type of flag image: png, gif, jpeg

linkCurrent

DataType
boolean
Default
true
Required
false
Description
Sets flag to link current language or not

classCurrent

DataType
string
Default
'current'
Required
false
Description
Sets the class, by which the current language will be marked

as

DataType
string
Default
'languageMenu'
Required
false
Description
If used, stores the menu pages as an array in a variable named according to this value and renders the tag content - which means automatic rendering is disabled if this attribute is used

pageUid

DataType
integer
Required
false
Description
Optional page uid to use.

configuration

DataType
mixed
Default
array ()
Required
false
Description
Additional typoLink configuration

excludeQueryVars

DataType
string
Required
false
Description
Comma-separate list of variables to exclude

languages

DataType
mixed
Required
false
Description
Array, CSV or Traversable containing UIDs of languages to render

page.language ViewHelper <vhs:page.language>

Returns the current language from languages depending on l18n settings.

Arguments

languages

DataType
mixed
Required
false
Description
The languages (either CSV, array or implementing Traversable)

pageUid

DataType
integer
Required
false
Description
The page uid to check

normalWhenNoLanguage

DataType
boolean
Required
false
Description
If TRUE, a missing page overlay should be ignored

page.resources ViewHelper <vhs:page.resources>

Page FAL resources ViewHelper.

Arguments

table

DataType
string
Default
'pages'
Required
false
Description
The table to lookup records.

field

DataType
string
Default
'media'
Required
false
Description
The field of the table associated to resources.

record

DataType
mixed
Required
false
Description
The actual record. Alternatively you can use the "uid" argument.

uid

DataType
integer
Required
false
Description
The uid of the record. Alternatively you can use the "record" argument.

as

DataType
string
Required
false
Description
If specified, a template variable with this name containing the requested data will be inserted instead of returning it.

page.rootline ViewHelper <vhs:page.rootline>

ViewHelper to get the rootline of a page.

Arguments

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

pageUid

DataType
integer
Required
false
Description
Optional page uid to use.

page.staticPrefix ViewHelper <vhs:page.staticPrefix>

Page: Static Prefix

Use this ViewHelper to read the contents of the plugin.tx_vhs.settings.prependPath TypoScript location - this setting stores the static prefix which gets added to all relative resource URIs generated by VHS; whenever you require a ViewHelper which does not respect this setting you can use this ViewHelper to prepend that setting after the value is returned from the other ViewHelper.

Arguments

This ViewHelper has no arguments.

page.header.alternate ViewHelper <vhs:page.header.alternate>

Returns the all alternate urls.

Arguments

languages

DataType
mixed
Required
true
Description
The languages (either CSV, array or implementing Traversable)

pageUid

DataType
integer
Required
false
Description
The page uid to check

normalWhenNoLanguage

DataType
boolean
Required
false
Description
If TRUE, a missing page overlay should be ignored

addQueryString

DataType
boolean
Required
false
Description
If TRUE, the current query parameters will be kept in the URI

page.header.canonical ViewHelper <vhs:page.header.canonical>

Returns the current canonical url in a link tag.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

pageUid

DataType
integer
Required
false
Description
The page uid to check

queryStringMethod

DataType
string
Default
'GET'
Required
false
Description
From which place to add parameters. Values: "GET", "POST" and "GET,POST". See https://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Typolink/Index.html, addQueryString.method

normalWhenNoLanguage

DataType
boolean
Required
false
Description
DEPRECATED: Visibility is now handled by core's typolink function.

page.header.meta ViewHelper <vhs:page.header.meta>

ViewHelper used to render a meta tag

If you use the ViewHelper in a plugin it has to be USER not USER_INT, what means it has to be cached!

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

name

DataType
string
Required
false
Description
Name property of meta tag

http-equiv

DataType
string
Required
false
Description
Property: http-equiv

property

DataType
string
Required
false
Description
Property of meta tag

content

DataType
string
Required
false
Description
Content of meta tag

scheme

DataType
string
Required
false
Description
Property: scheme

lang

DataType
string
Required
false
Description
Property: lang

dir

DataType
string
Required
false
Description
Property: dir

page.header.title ViewHelper <vhs:page.header.title>

ViewHelper used to override page title

This ViewHelper uses the TYPO3 PageRenderer to set the page title - with everything this implies regarding support for TypoScript settings.

Specifically you should note the setting config.noPageTitle which must be set to either 1 (one) in case no other source defines the page title (it's likely that at least one does), or 2 (two) to indicate that the TS-controlled page title must be disabled. A value of 2 (two) ensures that the title used in this ViewHelper will be used in the rendered page.

If you use the ViewHelper in a plugin it has to be USER not USER_INT, what means it has to be cached!

Why can I not forcibly override the title?

This has been opted out with full intention. The reasoning behind not allowing a Fluid template to forcibly override the page title that may be set through TypoScript is that many other extensions (mainly SEO-focused ones) will be setting and manipulating the page title - and if overridden in a template file using a ViewHelper, it would be almost impossible to detect unless you already know exactly where to look. Enforcing use of the core behavior is the only way to ensure that this ViewHelper can coexist with other extensions in a fully controllable way.

Arguments

title

DataType
string
Required
false
Description
Title tag content

whitespaceString

DataType
string
Default
' '
Required
false
Description
String used to replace groups of white space characters, one replacement inserted per group

setIndexedDocTitle

DataType
boolean
Required
false
Description
Set indexed doc title to title

page.resources.fal ViewHelper <vhs:page.resources.fal>

Page FAL resource ViewHelper.

Do not use the "uid" argument in the "Preview" section. Instead, use the "record" argument and pass the entire record. This bypasses visibility restrictions that normally apply when you attempt to load a record by UID through TYPO3's PageRepository, which is what the resource ViewHelpers do if you only pass uid.

Arguments

table

DataType
string
Default
'pages'
Required
false
Description
The table to lookup records.

field

DataType
string
Default
'media'
Required
false
Description
The field of the table associated to resources.

record

DataType
mixed
Required
false
Description
The actual record. Alternatively you can use the "uid" argument.

uid

DataType
integer
Required
false
Description
The uid of the record. Alternatively you can use the "record" argument.

as

DataType
string
Required
false
Description
If specified, a template variable with this name containing the requested data will be inserted instead of returning it.

asObjects

DataType
boolean
Required
false
Description
Can be set to TRUE to return objects instead of file information arrays.

limit

DataType
integer
Required
false
Description
Optional limit to the total number of records to render

slide

DataType
integer
Required
false
Description
Enables Record Sliding - amount of levels which shall get walked up the rootline, including the current page. For infinite sliding (till the rootpage) set to -1. Only the first PID which has at minimum one record is used.

slideCollect

DataType
integer
Required
false
Description
If TRUE, content is collected up the root line. If FALSE, only the first PID which has content is used. If greater than zero, this value overrides $slide.

slideCollectReverse

DataType
boolean
Required
false
Description
Normally when collecting records the elements from the actual page get shown on the top and those from the parent pages below those. You can invert this behaviour (actual page elements at bottom) by setting this flag.

random.number ViewHelper <vhs:random.number>

Random: Number Generator

Generates a random number. The default minimum number is set to 100000 in order to generate a longer integer string representation. Decimal values can be generated as well.

Arguments

minimum

DataType
integer
Default
100000
Required
false
Description
Minimum number - defaults to 100000 (default max is 999999 for equal string lengths)

maximum

DataType
integer
Default
999999
Required
false
Description
Maximum number - defaults to 999999 (default min is 100000 for equal string lengths)

minimumDecimals

DataType
integer
Required
false
Description
Minimum number of also randomized decimal digits to add to number

maximumDecimals

DataType
integer
Required
false
Description
Maximum number of also randomized decimal digits to add to number

random.string ViewHelper <vhs:random.string>

Random: String Generator

Use either minimumLength / maximumLength or just length.

Specify the characters which can be randomized using characters.

Arguments

length

DataType
integer
Required
false
Description
Length of string to generate

minimumLength

DataType
integer
Default
32
Required
false
Description
Minimum length of string if random length

maximumLength

DataType
integer
Default
32
Required
false
Description
Minimum length of string if random length

characters

DataType
string
Default
'0123456789abcdef'
Required
false
Description
Characters to use in string

render.ascii ViewHelper <vhs:render.ascii>

Render: ASCII Character

Renders a single character identified by its charset number.

For example: <v:render.character ascii="10" /> renders a UNIX linebreak as does {v:render.character(ascii: 10)}. Can be used in combination with v:iterator.loop` to render sequences or repeat the same character:

{v:render.ascii(ascii: 10) -> v:iterator.loop(count: 5)}
Copied!

And naturally you can feed any integer variable or ViewHelper return value into the ascii parameter throught renderChildren to allow chaining:

{variableWithAsciiInteger -> v:render.ascii()}
Copied!

And arrays are also supported - they will produce a string of characters from each number in the array:

{v:render.ascii(ascii: {0: 13, 1: 10})}
Copied!

Will produce a Windows line break, rn.

Arguments

ascii

DataType
mixed
Required
false
Description
ASCII character to render

render.cache ViewHelper <vhs:render.cache>

Cache Rendering ViewHelper

Caches the child content (any type supported as long as it can be serialized). Because of the added overhead you should only use this if what you are caching is complex enough that it performs many DB request (for example when displaying an object with many lazy properties which don't load until the template asks for the property value). In short, applies to just about the same use cases as any other cache - but remember that Fluid is already a very efficient rendering engine so don't just assume that using the ViewHelper will increase performance or decrease memory usage.

Works forcibly, i.e. can only re-render its content if the cache is cleared. A CTRL+Refresh in the browser does nothing, even if a BE user is logged in. Only use this ViewHelper around content which you are absolutely sure it makes sense to cache along with an identity - for example, if rendering an uncached plugin which contains a Partial template that is in all aspects just a solid-state HTML representation of something like a list of current news.

The cache behind this ViewHelper is the Extbase object cache, which is cleared when you clear the page content cache.

Do not use on form elements, it will invalidate the checksum.

Do not use around ViewHelpers which add header data or which interact with the PageRenderer or other "live" objects; this includes many of the VHS ViewHelpers!

Arguments

content

DataType
string
Required
false
Description
Content to be cached

identity

DataType
string
Required
true
Description
Identity for cached entry

onError

DataType
string
Required
false
Description
Optional error message to display if error occur while rendering. If NULL, lets the error Exception pass trough (and break rendering)

graceful

DataType
boolean
Required
false
Description
If forced to FALSE, errors are not caught but rather "transmitted" as every other error would be

render.inline ViewHelper <vhs:render.inline>

Render: Inline

Render as string containing Fluid as if it were part of the template currently being rendered.

Environment (template variables etc.) is cloned but not re-merged after rendering, which means that any and all changes in variables that happen while rendering this inline code will be destroyed after sub-rendering is finished.

Arguments

content

DataType
string
Required
false
Description
Template code to render as Fluid (usually from a variable)

namespaces

DataType
mixed
Default
array ()
Required
false
Description
Optional additional/overridden namespaces, ["ns" => "MyVendorMyExtViewHelpers"]

onError

DataType
string
Required
false
Description
Optional error message to display if error occur while rendering. If NULL, lets the error Exception pass trough (and break rendering)

graceful

DataType
boolean
Required
false
Description
If forced to FALSE, errors are not caught but rather "transmitted" as every other error would be

render.record ViewHelper <vhs:render.record>

ViewHelper used to render raw content records typically fetched with <v:content.get(column: '0', render: FALSE) />.

If you simply want to render a content element, try <v:content.render>.

Arguments

column

DataType
integer
Required
false
Description
Column position number (colPos) of the column to render

order

DataType
string
Default
'sorting'
Required
false
Description
Optional sort field of content elements - RAND() supported. Note that when sliding is enabled, the sorting will be applied to records on a per-page basis and not to the total set of collected records.

sortDirection

DataType
string
Default
'ASC'
Required
false
Description
Optional sort direction of content elements

pageUid

DataType
integer
Required
false
Description
If set, selects only content from this page UID. Ignored when "contentUids" is specified.

contentUids

DataType
mixed
Required
false
Description
If used, replaces all conditions with an "uid IN (1,2,3)" style condition using the UID values from this array

sectionIndexOnly

DataType
boolean
Required
false
Description
If TRUE, only renders/gets content that is marked as "include in section index"

loadRegister

DataType
mixed
Required
false
Description
List of LOAD_REGISTER variable

render

DataType
boolean
Default
true
Required
false
Description
Render result

hideUntranslated

DataType
boolean
Required
false
Description
If FALSE, will NOT include elements which have NOT been translated, if current language is NOT the default language. Default is to show untranslated elements but never display the original if there is a translated version

limit

DataType
integer
Required
false
Description
Optional limit to the total number of records to render

slide

DataType
integer
Required
false
Description
Enables Record Sliding - amount of levels which shall get walked up the rootline, including the current page. For infinite sliding (till the rootpage) set to -1. Only the first PID which has at minimum one record is used.

slideCollect

DataType
integer
Required
false
Description
If TRUE, content is collected up the root line. If FALSE, only the first PID which has content is used. If greater than zero, this value overrides $slide.

slideCollectReverse

DataType
boolean
Required
false
Description
Normally when collecting records the elements from the actual page get shown on the top and those from the parent pages below those. You can invert this behaviour (actual page elements at bottom) by setting this flag.

record

DataType
mixed
Required
false
Description
Record to render

render.request ViewHelper <vhs:render.request>

Render: Request

Renders a sub-request to the desired Extension, Plugin, Controller and action with the desired arguments.

Note: arguments must not be wrapped with the prefix used in GET/POST parameters but must be provided as if the arguments were sent directly to the Controller action.

Arguments

onError

DataType
string
Required
false
Description
Optional error message to display if error occur while rendering. If NULL, lets the error Exception pass trough (and break rendering)

graceful

DataType
boolean
Required
false
Description
If forced to FALSE, errors are not caught but rather "transmitted" as every other error would be

action

DataType
string
Required
false
Description
Controller action to call in request

controller

DataType
string
Required
false
Description
Controller name to call in request

extensionName

DataType
string
Required
false
Description
Extension name scope to use in request

vendorName

DataType
string
Required
false
Description
Vendor name scope to use in request. WARNING: only applies to TYPO3 versions below 10.4

pluginName

DataType
string
Required
false
Description
Plugin name scope to use in request

arguments

DataType
mixed
Required
false
Description
Arguments to use in request

render.template ViewHelper <vhs:render.template>

Render: Template

Render a template file (with arguments if desired).

Supports passing variables and controlling the format, paths can be overridden and uses the same format as TS settings a' la plugin.tx_myext.view, which means that this can be done (from any extension, not just "foo")

<v:render.template
 file="EXT:foo/Resources/Private/Templates/Action/Show.html"
 variables="{object: customLoadedObject}"
 paths="{v:variable.typoscript(path: 'plugin.tx_foo.view')}"
 format="xml" />
Copied!

Which would render the "show" action's template from EXT:foo using paths define in that extension's typoscript but using a custom loaded object when rendering the template rather than the object defined by the "Action" controller of EXT:foo. The output would be in XML format and this format would also be respected by Layouts and Partials which are rendered from the Show.html template.

As such this is very similar to Render/RequestViewHelper with two major differences:

  1. A true ControllerContext is not present when rendering which means that links generated in the template should be made always including all parameters from ExtensionName over PluginName through the usual action etc.
  2. The Controller from EXT:foo is not involved in any way, which means that any custom variables the particular template depends on must be added manually through the "variables" argument

Consider using Render/InlineViewHelper if you are rendering templates from the same plugin.

Consider using Render/RequestViewHelper if you require a completely isolated rendering identical to that which takes place when rendering an Extbase plugin's content object.

Arguments

onError

DataType
string
Required
false
Description
Optional error message to display if error occur while rendering. If NULL, lets the error Exception pass trough (and break rendering)

graceful

DataType
boolean
Required
false
Description
If forced to FALSE, errors are not caught but rather "transmitted" as every other error would be

file

DataType
string
Required
false
Description
Path to template file, EXT:myext/... paths supported

variables

DataType
mixed
Required
false
Description
Optional array of template variables for rendering

format

DataType
string
Required
false
Description
Optional format of the template(s) being rendered

paths

DataType
mixed
Required
false
Description
Optional array of arrays of layout and partial root paths, EXT:mypath/... paths supported

render.uncache ViewHelper <vhs:render.uncache>

Uncaches partials. Use like f:render. The partial will then be rendered each time. Please be aware that this will impact render time. Arguments must be serializable and will be cached.

Arguments

partial

DataType
string
Required
true
Description
Reference to a partial.

section

DataType
string
Required
false
Description
Name of section inside the partial to render.

arguments

DataType
mixed
Required
false
Description
Arguments to pass to the partial.

persistPartialPaths

DataType
boolean
Default
true
Required
false
Description
Normally, v:render.uncache will persist the partialRootPaths array that was active when the ViewHelperwas called, so the exact paths will be reused when rendering the uncached portion of the page output. This is done to ensure that even if you manually added some partial paths through some dynamic means (for example, based on a controller argument) then those paths would be used. However, in some cases this will be undesirable - namely when using a cache that is shared between multiple TYPO3 instances and each instance has a different path in the server's file system (e.g. load balanced setups). On such setups you should set persistPartialPaths="0" on this ViewHelper to prevent it from caching the resolved partialRootPaths. The ViewHelper will then instead use whichever partialRootPaths are configured for the extension that calls v:render.uncache. Note that when this is done, the special use case of dynamic or controller-overridden partialRootPaths is simply not supported.

resource.file ViewHelper <vhs:resource.file>

ViewHelper to output or assign FAL sys_file records.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

identifier

DataType
mixed
Required
false
Description
The FAL combined identifiers (either CSV, array or implementing Traversable).

categories

DataType
mixed
Required
false
Description
The sys_category records to select the resources from (either CSV, array or implementing Traversable).

treatIdAsUid

DataType
boolean
Required
false
Description
If TRUE, the identifier argument is treated as resource uids.

treatIdAsReference

DataType
boolean
Required
false
Description
If TRUE, the identifier argument is treated as reference uids and will be resolved to resources via sys_file_reference.

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

onlyProperties

DataType
boolean
Default
true
Required
false
Description
Whether to return only the properties array of the sys_file record and not the File object itself

resource.image ViewHelper <vhs:resource.image>

ViewHelper to output or assign a image from FAL.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

identifier

DataType
mixed
Required
false
Description
The FAL combined identifiers (either CSV, array or implementing Traversable).

categories

DataType
mixed
Required
false
Description
The sys_category records to select the resources from (either CSV, array or implementing Traversable).

treatIdAsUid

DataType
boolean
Required
false
Description
If TRUE, the identifier argument is treated as resource uids.

treatIdAsReference

DataType
boolean
Required
false
Description
If TRUE, the identifier argument is treated as reference uids and will be resolved to resources via sys_file_reference.

relative

DataType
boolean
Default
true
Required
false
Description
If FALSE resource URIs are rendered absolute. URIs in backend mode are always absolute.

width

DataType
string
Required
false
Description
Width of the image. Numeric value in pixels or simple calculations. See imgResource.width for possible options.

height

DataType
string
Required
false
Description
Height of the image. Numeric value in pixels or simple calculations. See imgResource.width for possible options.

minWidth

DataType
string
Required
false
Description
Minimum width of the image. Numeric value in pixels or simple calculations. See imgResource.width for possible options.

minHeight

DataType
string
Required
false
Description
Minimum height of the image. Numeric value in pixels or simple calculations. See imgResource.width for possible options.

maxWidth

DataType
string
Required
false
Description
Maximum width of the image. Numeric value in pixels or simple calculations. See imgResource.width for possible options.

maxHeight

DataType
string
Required
false
Description
Maximum height of the image. Numeric value in pixels or simple calculations. See imgResource.width for possible options.

graceful

DataType
boolean
Required
false
Description
Set to TRUE to ignore files that cannot be loaded. Default behavior is to throw an Exception.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

usemap

DataType
string
Required
false
Description
A hash-name reference to a map element with which to associate the image.

ismap

DataType
string
Required
false
Description
Specifies that its img element provides access to a server-side image map.

alt

DataType
string
Required
false
Description
Equivalent content for those who cannot process images or who have image loading disabled.

as

DataType
string
Required
false
Description
If specified, a template variable with this name containing the requested data will be inserted instead of returning it.

resource.language ViewHelper <vhs:resource.language>

Resource: Language

Reads a certain language file with returning not just one single label, but all the translated labels.

Examples

<!-- Tag usage for force getting labels in a specific language (different to current is possible too) -->
<v:resource.language extensionName="myext" path="Path/To/Locallang.xlf" languageKey="en"/>
Copied!
<!-- Tag usage for getting labels of current language -->
<v:resource.language extensionName="myext" path="Path/To/Locallang.xlf"/>

Copied!

Arguments

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

extensionName

DataType
string
Required
false
Description
Name of the extension

path

DataType
string
Default
'locallang.xlf'
Required
false
Description
Absolute or relative path to the locallang file

languageKey

DataType
string
Required
false
Description
Key for getting translation of a different than current initialized language

resource.record ViewHelper <vhs:resource.record>

Generic FAL resource ViewHelper.

Arguments

table

DataType
string
Required
true
Description
The table to lookup records.

field

DataType
string
Required
true
Description
The field of the table associated to resources.

record

DataType
mixed
Required
false
Description
The actual record. Alternatively you can use the "uid" argument.

uid

DataType
integer
Required
false
Description
The uid of the record. Alternatively you can use the "record" argument.

as

DataType
string
Required
false
Description
If specified, a template variable with this name containing the requested data will be inserted instead of returning it.

resource.record.fal ViewHelper <vhs:resource.record.fal>

Resolve FAL relations and return file records.

Render a single image linked from a TCA record

We assume that the table tx_users has a column photo, which is a FAL relation field configured with [ExtensionManagementUtility::getFileFieldTCAConfig()] (https://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Inline/Index.html#file-abstraction-layer). The template also has a user variable containing one of the table's records.

At first, fetch the record and store it in a variable. Then use <f:image> to render it:

{v:resource.record.fal(table: 'tx_users', field: 'photo', record: user)
 -> v:iterator.first()
 -> v:variable.set(name: 'image')}
<f:if condition="{image}">
  <f:image treatIdAsReference="1" src="{image.id}" title="{image.title}" alt="{image.alternative}"/>
</f:if>
Copied!

Use the uid attribute if you don't have a record.

Arguments

table

DataType
string
Required
true
Description
The table to lookup records.

field

DataType
string
Required
true
Description
The field of the table associated to resources.

record

DataType
mixed
Required
false
Description
The actual record. Alternatively you can use the "uid" argument.

uid

DataType
integer
Required
false
Description
The uid of the record. Alternatively you can use the "record" argument.

as

DataType
string
Required
false
Description
If specified, a template variable with this name containing the requested data will be inserted instead of returning it.

asObjects

DataType
boolean
Required
false
Description
Can be set to TRUE to return objects instead of file information arrays.

security.allow ViewHelper <vhs:security.allow>

Security: Allow

Allows access to the child content based on given arguments. The ViewHelper is a condition based ViewHelper which means it supports the f:then and f:else child nodes - you can use this behaviour to invert the access (i.e. use f:else in a check if a frontend user is logged in, if you want to hide content from authenticated users):

<v:security.allow anyFrontendUser="TRUE">
    <f:then><!-- protected information displayed --></f:then>
    <f:else><!-- link to login form displayed --></f:else>
</v:security.allow>
Copied!

Is the mirror opposite of v:security.deny.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

anyFrontendUser

DataType
boolean
Required
false
Description
If TRUE, allows any FrontendUser unless other arguments disallows each specific FrontendUser

anyFrontendUserGroup

DataType
boolean
Required
false
Description
If TRUE, allows any FrontendUserGroup unless other arguments disallows each specific FrontendUser

frontendUser

DataType
mixed
Required
false
Description
The FrontendUser to allow/deny

frontendUsers

DataType
mixed
Required
false
Description
The FrontendUsers ObjectStorage to allow/deny

frontendUserGroup

DataType
mixed
Required
false
Description
The FrontendUserGroup to allow/deny

frontendUserGroups

DataType
mixed
Required
false
Description
The FrontendUserGroups ObjectStorage to allow/deny

anyBackendUser

DataType
boolean
Required
false
Description
If TRUE, allows any backend user unless other arguments disallows each specific backend user

backendUser

DataType
integer
Required
false
Description
The uid of a backend user to allow/deny

backendUsers

DataType
mixed
Required
false
Description
The backend users list to allow/deny. If string, CSV of uids assumed, if array, array of uids assumed

backendUserGroup

DataType
integer
Required
false
Description
The uid of the backend user group to allow/deny

backendUserGroups

DataType
mixed
Required
false
Description
The backend user groups list to allow/deny. If string, CSV of uids is assumed, if array, array of uids is assumed

admin

DataType
boolean
Required
false
Description
If TRUE, a backend user which is also an admin is required

evaluationType

DataType
string
Default
'AND'
Required
false
Description
Specify AND or OR (case sensitive) to determine how arguments must be processed. Default is AND, requiring all arguments to be satisfied if used

security.deny ViewHelper <vhs:security.deny>

Security: Deny

Denies access to the child content based on given arguments. The ViewHelper is a condition based ViewHelper which means it supports the f:then and f:else child nodes.

Is the mirror opposite of v:security.allow.

Arguments

then

DataType
mixed
Required
false
Description
Value to be returned if the condition if met.

else

DataType
mixed
Required
false
Description
Value to be returned if the condition if not met.

anyFrontendUser

DataType
boolean
Required
false
Description
If TRUE, allows any FrontendUser unless other arguments disallows each specific FrontendUser

anyFrontendUserGroup

DataType
boolean
Required
false
Description
If TRUE, allows any FrontendUserGroup unless other arguments disallows each specific FrontendUser

frontendUser

DataType
mixed
Required
false
Description
The FrontendUser to allow/deny

frontendUsers

DataType
mixed
Required
false
Description
The FrontendUsers ObjectStorage to allow/deny

frontendUserGroup

DataType
mixed
Required
false
Description
The FrontendUserGroup to allow/deny

frontendUserGroups

DataType
mixed
Required
false
Description
The FrontendUserGroups ObjectStorage to allow/deny

anyBackendUser

DataType
boolean
Required
false
Description
If TRUE, allows any backend user unless other arguments disallows each specific backend user

backendUser

DataType
integer
Required
false
Description
The uid of a backend user to allow/deny

backendUsers

DataType
mixed
Required
false
Description
The backend users list to allow/deny. If string, CSV of uids assumed, if array, array of uids assumed

backendUserGroup

DataType
integer
Required
false
Description
The uid of the backend user group to allow/deny

backendUserGroups

DataType
mixed
Required
false
Description
The backend user groups list to allow/deny. If string, CSV of uids is assumed, if array, array of uids is assumed

admin

DataType
boolean
Required
false
Description
If TRUE, a backend user which is also an admin is required

evaluationType

DataType
string
Default
'AND'
Required
false
Description
Specify AND or OR (case sensitive) to determine how arguments must be processed. Default is AND, requiring all arguments to be satisfied if used

site.name ViewHelper <vhs:site.name>

Site: Name

Returns the site name as specified in $TYPO3_CONF_VARS.

Arguments

This ViewHelper has no arguments.

site.url ViewHelper <vhs:site.url>

Site: URL

Returns the website URL as returned by \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL')

Arguments

This ViewHelper has no arguments.

system.dateTime ViewHelper <vhs:system.dateTime>

System: DateTime

Returns the current system UNIX timestamp as DateTime.

Arguments

This ViewHelper has no arguments.

system.timestamp ViewHelper <vhs:system.timestamp>

System: UNIX Timestamp

Returns the current system UNIX timestamp as integer. Useful combined with the Math group of ViewHelpers:

<!-- adds exactly one hour to a DateTime and formats it -->
<f:format.date format="H:i">{dateTime.timestamp -> v:math.sum(b: 3600)}</f:format.date>

Copied!

Arguments

This ViewHelper has no arguments.

system.uniqId ViewHelper <vhs:system.uniqId>

System: Unique ID

Returns a unique ID based on PHP's uniqid-function.

Comes in useful when handling/generating html-element-IDs for usage with JavaScript.

Arguments

prefix

DataType
string
Required
false
Description
An optional prefix for making sure it's unique across environments

moreEntropy

DataType
boolean
Required
false
Description
Add some pseudo random strings. Refer to uniqid()'s Reference.

uri.gravatar ViewHelper <vhs:uri.gravatar>

Renders Gravatar URI.

Arguments

email

DataType
string
Required
true
Description
Email address

size

DataType
integer
Required
false
Description
Size in pixels, defaults to 80px [ 1 - 2048 ]

imageSet

DataType
string
Required
false
Description
Default image set to use. Possible values [ 404 | mm | identicon | monsterid | wavatar ]

maximumRating

DataType
string
Required
false
Description
Maximum rating (inclusive) [ g | pg | r | x ]

secure

DataType
boolean
Default
true
Required
false
Description
If it is FALSE will return the un secure Gravatar domain (www.gravatar.com)

uri.image ViewHelper <vhs:uri.image>

Uri: Image

Returns the relative or absolute URI for the image resource or it's derivate if differing dimesions are provided.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

src

DataType
mixed
Required
true
Description
Path to the media resource(s). Can contain single or multiple paths for videos/audio (either CSV, array or implementing Traversable).

relative

DataType
boolean
Default
true
Required
false
Description
If FALSE media URIs are rendered absolute. URIs in backend mode are always absolute.

width

DataType
string
Required
false
Description
Width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

height

DataType
string
Required
false
Description
Height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.

maxW

DataType
integer
Required
false
Description
Maximum Width of the image. (no upscaling)

maxH

DataType
integer
Required
false
Description
Maximum Height of the image. (no upscaling)

minW

DataType
integer
Required
false
Description
Minimum Width of the image.

minH

DataType
integer
Required
false
Description
Minimum Height of the image.

format

DataType
string
Required
false
Description
Format of the processed file - also determines the target file format. If blank, TYPO3/IM/GM default is taken into account.

quality

DataType
integer
Default
90
Required
false
Description
Quality of the processed image. If blank/not present falls back to the default quality defined in install tool.

treatIdAsReference

DataType
boolean
Required
false
Description
When TRUE treat given src argument as sys_file_reference record. Applies only to TYPO3 6.x and above.

canvasWidth

DataType
integer
Required
false
Description
Width of an optional canvas to place the image on.

canvasHeight

DataType
integer
Required
false
Description
Height of an optional canvas to place the image on.

canvasColor

DataType
string
Required
false
Description
Background color of an optional canvas to place the image on (hex triplet).

transparencyColor

DataType
string
Required
false
Description
Color to set transparent when using canvas feature (hex triplet).

crop

DataType
string
Required
false
Description
Information generated by the backend's graphical cropping UI

graceful

DataType
boolean
Required
false
Description
Set to TRUE to ignore files that cannot be loaded. Default behavior is to throw an Exception.

uri.request ViewHelper <vhs:uri.request>

Uri: Request

Returns the Uri of the requested page (site_url + all the GET params) \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL').

Arguments

This ViewHelper has no arguments.

variable.convert ViewHelper <vhs:variable.convert>

Convert ViewHelper

Converts $value to $type which can be one of 'string', 'integer', 'float', 'boolean', 'array' or 'ObjectStorage'. If $value is NULL sensible defaults are assigned or $default which obviously has to be of $type as well.

Arguments

value

DataType
mixed
Required
false
Description
Value to convert into a different type

type

DataType
string
Required
true
Description
Data type to convert the value into. Can be one of "string", "integer", "float", "boolean", "array" or "ObjectStorage".

default

DataType
mixed
Required
false
Description
Optional default value to assign to the converted variable in case it is NULL.

variable.extensionConfiguration ViewHelper <vhs:variable.extensionConfiguration>

ExtConf ViewHelper

Reads settings from ext_conf_template.txt

Examples

{v:variable.extensionConfiguration(extensionKey:'foo',path:'bar.baz')}
Copied!

Returns setting bar.baz from extension 'foo' located in ext_conf_template.txt.

Arguments

extensionKey

DataType
string
Required
false
Description
Extension key (lowercase_underscored format) to read configuration from

path

DataType
string
Required
false
Description
Configuration path to read - if NULL, returns all configuration as array

variable.get ViewHelper <vhs:variable.get>

Variable: Get

ViewHelper used to read the value of a current template variable. Can be used with dynamic indices in arrays:

<v:variable.get name="array.{dynamicIndex}" />
<v:variable.get name="array.{v:variable.get(name: 'arrayOfSelectedKeys.{indexInArray}')}" />
<f:for each="{v:variable.get(name: 'object.arrayProperty.{dynamicIndex}')}" as="nestedObject">
    ...
</f:for>
Copied!

Or to read names of variables which contain dynamic parts:

<!-- if {variableName} is "Name", outputs value of {dynamicName} -->
{v:variable.get(name: 'dynamic{variableName}')}
Copied!

If your target object is an array with unsequential yet numeric indices (e.g. {123: 'value1', 513: 'value2'}, commonly seen in reindexed UID map arrays) use useRawKeys="TRUE" to indicate you do not want your array/QueryResult/Iterator to be accessed by locating the Nth element - which is the default behavior.

Do not try `useRawKeys="TRUE"` on QueryResult or
ObjectStorage unless you are fully aware what you are
doing. These particular types require an unpredictable
index value - the SPL object hash value - when accessing
members directly. This SPL indexing and the very common
occurrences of QueryResult and ObjectStorage variables
in templates is the very reason why `useRawKeys` by
default is set to `FALSE`.

Copied!

Arguments

name

DataType
string
Required
false
Description
Name of variable to retrieve

useRawKeys

DataType
boolean
Required
false
Description
If TRUE, the path is directly passed to ObjectAccess. If FALSE, a custom and compatible VHS method is used

variable.pregMatch ViewHelper <vhs:variable.pregMatch>

PregMatch regular expression ViewHelper

Implementation of `preg_match' for Fluid.

Arguments

as

DataType
string
Required
false
Description
Template variable name to assign; if not specified the ViewHelper returns the variable instead.

pattern

DataType
mixed
Required
true
Description
Regex pattern to match against

subject

DataType
mixed
Required
false
Description
String to match with the regex pattern

global

DataType
boolean
Required
false
Description
Match global

variable.set ViewHelper <vhs:variable.set>

Variable: Set

Sets a single variable in the TemplateVariableContainer scope. The variable then becomes accessible as {var}.

Combines well with v:variable.get to set shorter variable names referencing dynamic variables, such as:

<v:variable.set name="myObject" value="{v:variable.get(name: 'arrayVariable.{offset}')}" />
<!-- If {index} == 4 then {myObject} is now == {arrayVariable.4} -->
{myObject.name} <!-- corresponds to {arrayVariable.4.name} -->
Copied!

Note that {arrayVariable.{offset}.name} is not possible due to the way Fluid parses nodes; the above piece of code would try reading arrayVariable.{offset}.name as a variable actually called "arrayVariable.{offset}.name" rather than the correct arrayVariable[offset][name].

In many ways this ViewHelper works like f:alias with one exception: in f:alias the variable only becomes accessible in the tag content, whereas v:variable.set inserts the variable in the template and leaves it there (it "leaks" the variable).

If $name contains a dot, VHS will attempt to load the object stored under the named used as the first segment part and set the value at the remaining path. E.g. {value -> v:variable.set(name: 'object.property.subProperty')} would attempt to load {object} first, then set property.subProperty on that object/array using ObjectAccess::setPropertyPath(). If {object} is not an object or an array, the variable will not be set. Please note: Extbase does not currently support setting variables deeper than two levels, meaning a name of fx foo.bar.baz will be ignored. To set values deeper than two levels you must first extract the second-level object then set the value on that object.

Using as {value -> v:variable.set(name: 'myVar')} makes {myVar} contain {value}.

Arguments

value

DataType
mixed
Required
false
Description
Value to set

name

DataType
string
Required
false
Description
Name of variable to assign

variable.typoscript ViewHelper <vhs:variable.typoscript>

Variable: TypoScript

Accesses Typoscript paths. Contrary to the Fluid-native f:cObject this ViewHelper does not render objects but rather retrieves the values. For example, if you retrieve a TypoScript path to a TMENU object you will receive the array of TypoScript defining the menu - not the rendered menu HTML.

A great example of how to use this ViewHelper is to very quickly migrate a TypoScript-menu-based site (for example currently running TemplaVoila + TMENU-objects) to a Fluid ViewHelper menu based on v:page.menu or v:page.breadCrumb by accessing key configuration options such as entryLevel and even various wrap definitions.

A quick example of how to parse a wrap TypoScript setting into two variables usable for a menu item:

<!-- This piece to be added as far up as possible in order to prevent multiple executions -->
<v:variable.set name="menuSettings" value="{v:variable.typoscript(path: 'lib.menu.main.stdWrap')}" />
<v:variable.set name="wrap" value="{menuSettings.wrap -> v:iterator.explode(glue: '|')}" />
Copied!
<!-- This in the loop which renders the menu (see "VHS: manual menu rendering" in FAQ): -->
{wrap.0}{menuItem.title}{wrap.1}
Copied!
<!-- An additional example to demonstrate very compact conditions which prevent wraps from being displayed -->
{wrap.0 -> f:if(condition: settings.wrapBefore)}{menuItem.title}{wrap.1 -> f:if(condition: settings.wrapAfter)}

Copied!

Arguments

path

DataType
string
Required
false
Description
Path to TypoScript value or configuration array

variable.unset ViewHelper <vhs:variable.unset>

Variable: Unset

Quite simply, removes a currently available variable from the TemplateVariableContainer:

<!-- Data: {person: {name: 'Elvis', nick: 'King'}} -->
I'm {person.name}. Call me "{person.nick}". A ding-dang doo!
<v:variable.unset name="person" />
<f:if condition="{person}">
    <f:else>
        You saw this coming...
        <em>Elvis has left the building</em>
    </f:else>
</f:if>
Copied!

At the time of writing this, v:variable.unset is not able to remove members of for example arrays:

<!-- DOES NOT WORK! -->
<v:variable.unset name="myObject.propertyName" />

Copied!

Arguments

name

DataType
string
Required
true
Description
Name of variable in variable container

variable.register.get ViewHelper <vhs:variable.register.get>

VariableRegister: Get

ViewHelper used to read the value of a TSFE-register Can be used to read names of variables which contain dynamic parts:

<!-- if {variableName} is "Name", outputs value of {dynamicName} -->
{v:variable.register.get(name: 'dynamic{variableName}')}

Copied!

Arguments

name

DataType
string
Required
false
Description
Name of register

variable.register.set ViewHelper <vhs:variable.register.set>

VariableRegister: Set

Sets a single register in the TSFE-register.

Using as {value -> v:variable.register.set(name: 'myVar')} makes $GLOBALS["TSFE"]->register['myVar'] contain {value}.

Arguments

value

DataType
mixed
Required
false
Description
Value to set

name

DataType
string
Required
true
Description
Name of register

Changelog

Please follow these links to find out which feature has been implemented or which bug has been fixed in which version.

List of versions

Contribution

Unlike most TYPO3 documentation, this manual does not support the popular Edit on GitHub workflow for manual contributions, as these documentation files are automatically generated from the ViewHelper source files - and overwritten on each generation run.

Therefore, contribute to this documentation by editing the appropriate source files at

For example, adding a new core feature list item to the asset page at

is done by editing the class comment in

To enrich the comment text you can use the common directives of the Markdown markup language.

Sitemap

Index

format.url.sanitizeString

Sanitizes a string

Arguments

string

DataType
string
Required
false
Description
The string to sanitize.

customMap

DataType
mixed
Required
false
Description
Associative array of additional characters to replace or use to override built-in mappings.