Documentation · ViewHelper reference

XSD schema file | vhs master

Content / RenderViewHelper

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}"/>

/

  • Tag usage example

    <v:content.render column="123" order="'sorting'" sortDirection="'ASC'" pageUid="123" contentUids="{foo: 'bar'}" sectionIndexOnly="1" loadRegister="{foo: 'bar'}" render="1" hideUntranslated="1" limit="123" slide="123" slideCollect="123" slideCollectReverse="1" as="NULL">
    	<!-- tag content - may be ignored! -->
    </v:content.render>
  • Inline usage example

    {v:content.render(column: 123, order: ''sorting'', sortDirection: ''ASC'', pageUid: 123, contentUids: {foo: 'bar'}, sectionIndexOnly: 1, loadRegister: {foo: 'bar'}, render: 1, hideUntranslated: 1, limit: 123, slide: 123, slideCollect: 123, slideCollectReverse: 1, as: 'NULL')}

Arguments

Argument Description Type
as

Template variable name to assign; if not specified the ViewHelper returns the variable instead.

string
column

Name of the column to render

integer
contentUids

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

array
hideUntranslated

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

boolean
limit

Optional limit to the total number of records to render

integer
loadRegister

List of LOAD_REGISTER variable

array
order

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.

string
pageUid

If set, selects only content from this page UID

integer
render

Render result

boolean
sectionIndexOnly

If TRUE, only renders/gets content that is marked as "include in section index"

boolean
slide

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

integer
slideCollect

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.

integer
slideCollectReverse

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))

boolean
sortDirection

Optional sort direction of content elements

string
Required attribute

Revision history

commit 1fa1afa15b9494dae5dacc38c72fb2ca14d3754e
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Wed Apr 3 21:41:38 2013 +0200

    [TASK] Refactor content view helpers into their own group

commit 71cbd33eb8a6297ecc52f8a27795d6c82dafc285
Author: Danilo Bürger <*****@hmspl.de>
Date:   Wed Dec 11 14:28:09 2013 +0100

    [TASK] CGL compliance for content.render

commit da31bad1d9bb058c072ddb5591e8ed907a1ae8e1
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Dec 31 23:08:37 2013 +0100

    [TASK] Happy new year!

commit 52bd6e41ccfef3d8193b350153912a9716e6a087
Author: Benjamin Rau <*****@codearts.at>
Date:   Tue Apr 1 21:09:00 2014 +0200

    [TASK] CGL compliance

commit da7677bc74f14e9a9300e4ba4487e52c3cb97642
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Apr 20 01:13:33 2014 +0200

    [TASK] Switch to namespaces

commit 12ff0ddfb8d36c51f2d3befde7ae812177c80d5d
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Wed Jun 11 00:01:47 2014 +0200

    [TASK] CGL remove use leading backslash
    PHP Docs
    Note that for namespaced names (fully qualified namespace names containing namespace separator, such as Foo\Bar as opposed to global names that do not, such as FooBar),
    the leading backslash is unnecessary and not recommended, as import names must be fully qualified, and are not processed relative to the current namespace.

commit 4981055359c895f3869e5bd878293b3c15ed26e5
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Sun Jan 18 14:01:04 2015 +0100

    [TASK] CGL - Define classes, params, use imports

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

    [TASK] Reference Copyright to license.md file