Documentation · ViewHelper reference

XSD schema file | vhs 2.1.4

TagViewHelper

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.

  • Tag usage example

    <v:tag additionalAttributes="{foo: 'bar'}" class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL" name="NULL" hideIfEmpty="1">
    	<!-- tag content - may be ignored! -->
    </v:tag>
  • Inline usage example

    {v:tag(additionalAttributes: {foo: 'bar'}, class: 'NULL', dir: 'NULL', id: 'NULL', lang: 'NULL', style: 'NULL', title: 'NULL', accesskey: 'NULL', tabindex: 123, onclick: 'NULL', name: 'NULL', hideIfEmpty: 1)}

Arguments

Argument Description Type
accesskey

Keyboard shortcut to access this element

string
additionalAttributes

Additional tag attributes. They will be added directly to the resulting HTML tag.

array
class

CSS class(es) for this element

string
dir

Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

string
hideIfEmpty

Hide the tag completely if there is no tag content

boolean
id

Unique (in this file) identifier for this HTML element.

string
lang

Language for this element. Use short names specified in RFC 1766

string
name

Tag name

string
onclick

JavaScript evaluated for the onclick event

string
style

Individual CSS styles for this element

string
tabindex

Specifies the tab order of this element

integer
title

Tooltip text of element

string
Required attribute

Revision history

commit 1c19c05be5244cf7cd9d7c552baa1699d1db47fb
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Wed Oct 1 22:25:15 2014 +0200

    [TASK] Port tag viewhelper from fluidcontent_core

commit 8826581b314cf42698914da707143ccf29344e1c
Author: jmverges <*****@gmail.com>
Date:   Tue Nov 18 20:04:57 2014 +0100

    [BUGFIX] Fixed hideIfEmpty argument. It was not used in code.

commit 8bb2fc5ee124ba19b0a0ab8e061c9a153fc4651f
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Sun Jan 18 17:56:13 2015 +0100

    [TASK] Reference Copyright to license.md file