Documentation · ViewHelper reference

XSD schema file | vhs master

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'}" data="{foo: 'bar'}" class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL" forceClosingTag="1" hideIfEmpty="1" contenteditable="NULL" contextmenu="NULL" draggable="NULL" dropzone="NULL" translate="NULL" spellcheck="NULL" hidden="NULL" name="NULL">
    	<!-- tag content - may be ignored! -->
    </v:tag>
  • Inline usage example

    {v:tag(additionalAttributes: {foo: 'bar'}, data: {foo: 'bar'}, class: 'NULL', dir: 'NULL', id: 'NULL', lang: 'NULL', style: 'NULL', title: 'NULL', accesskey: 'NULL', tabindex: 123, onclick: 'NULL', forceClosingTag: 1, hideIfEmpty: 1, contenteditable: 'NULL', contextmenu: 'NULL', draggable: 'NULL', dropzone: 'NULL', translate: 'NULL', spellcheck: 'NULL', hidden: 'NULL', name: 'NULL')}

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
contenteditable

Specifies whether the contents of the element are editable.

string
contextmenu

The value of the id attribute on the menu with which to associate the element as a context menu.

string
data

Additional data-* attributes. They will each be added with a "data-" prefix.

array
dir

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

string
draggable

Specifies whether the element is draggable.

string
dropzone

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.

string
forceClosingTag

If TRUE, forces the created tag to use a closing tag. If FALSE, allows self-closing tags.

boolean
hidden

Specifies that the element represents an element that is not yet, or is no longer, relevant.

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
spellcheck

Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking.

string
style

Individual CSS styles for this element

string
tabindex

Specifies the tab order of this element

integer
title

Tooltip text of element

string
translate

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.

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