Documentation · ViewHelper reference

XSD schema file | vhs master

Content / GetViewHelper

ViewHelper used to render get content elements in Fluid templates /

  • Tag usage example

    <v:content.get 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">
    	<!-- tag content - may be ignored! -->
    </v:content.get>
  • Inline usage example

    {v:content.get(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)}

Arguments

Argument Description Type
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

Return rendered 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 80f900fcb02a682e79ef34dce3c5af19640508c9
Author: Claus Due <*****@wildside.dk>
Date:   Tue Mar 5 00:25:15 2013 +0100

    [TASK] Refactor renderContent ViewHelper to Content / Get and Content / Render ViewHelpers

commit 1e87b36c75e678c21e91a0b3f74424537d886a5b
Author: Claus Due <*****@wildside.dk>
Date:   Mon Mar 18 20:20:15 2013 +0100

    [FEATURE] Add LOAD_REGISTER to Content / Get ViewHelper

commit 7dde8346eee4e372710f9c42310ed3e146c077e1
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Wed Mar 20 15:16:42 2013 +0100

    [BUGFIX] Fix undefined variable

commit e19e265917baf4749cbd05d5c366e94886b9daab
Author: Claus Due <*****@wildside.dk>
Date:   Mon Apr 1 15:21:39 2013 +0200

    [TASK] Switch to renamed Services, remove usage of removed Services

commit d3b4d8a7e6194a74050d381c12cc8113f60620f9
Author: Claus Due <*****@wildside.dk>
Date:   Sun Apr 7 15:20:56 2013 +0200

    [TASK] Further unify services into a single FluxService

commit 2cd84c1334eeb3f43bdde0a57ce7ed41048ec216
Author: Claus Due <*****@wildside.dk>
Date:   Sun Apr 21 12:41:26 2013 +0200

    [TASK] Move getChildContent to Content / Get ViewHelper

commit 754bf626cdf41d52a6940752449650b2fc719aa3
Author: Claus Due <*****@wildside.dk>
Date:   Fri Apr 26 11:58:20 2013 +0200

    [BUGFIX] Code style cleanups phase 5: References to missing variables

commit 383d844919aab159d13c7e5a127ceedc57f9748b
Author: Frederico Bernardin <*****@bernardin.it>
Date:   Sat May 18 21:17:44 2013 +0200

    [FEATURE] Attribute "render" to return records, Content Get ViewHelper

commit 4899a87cf63afdc672551534ac52872cfd0c99cb
Author: Claus Due <*****@wildside.dk>
Date:   Tue Jul 23 00:40:23 2013 +0200

    [TASK] Unit tests for Content Get and Render ViewHelpers

commit 24cf3275bb01ffa4a89db3632f869c7020cff3ff
Author: Danilo Bürger <*****@hmspl.de>
Date:   Thu Nov 21 19:25:00 2013 +0100

    [FEATURE] Added offset to flux:content.get

commit 75fcd37db43bef950b9378644d2b961635185c2a
Author: Thomas Allmer <*****@gmail.com>
Date:   Mon Nov 18 14:46:36 2013 +0100

    [TASK] Replace all calls to CMS functions with namespace equivalent
    
    A simple shell script was used for all the replacements
    https://gist.github.com/daKmoR/7490199

commit 5511d72d220d89627255e270d3ca178362f6c2b2
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Nov 24 19:31:01 2013 +0100

    [TASK] Switch to namespaces

commit 3878c943a6eb0924bb6db2e5ed8461580896431f
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Dec 10 01:59:34 2013 +0100

    [TASK] Update copyright and author tags
    
    Assumes "Claus Due" as author whenever no author is specified.

commit 8bf2b5beb89c7d72a41230f152d9a5a3d308ba84
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Dec 31 23:11:00 2013 +0100

    [TASK] Happy new year!

commit 543d33e81b5b092cfd3006e04e654844373f262e
Author: Claus Due <*****@namelesscoder.net>
Date:   Fri Jun 13 17:40:00 2014 +0200

    [TASK] Implement workspace aware RecordService in ViewHelpers

commit 022611afa475f7463ade53d58fe55898f7ae5689
Author: Mats Svensson <*****@pixelant.se>
Date:   Wed Aug 27 15:54:46 2014 +0200

    [BUGFIX] Missing child content elements in localized parents.
    
    When config.sys_language_overlay = 1, content elements with [Default] (not translated) and [All] languages are also rendered in the "localized parent". When config.sys_language_overlay = hideNonTranslated, content elements with [All] languages are also rendered in the "localized parent".

commit 12ec81dab953ba1d9365bc85dd809dd2fe0b90a0
Author: Claus Due <*****@namelesscoder.net>
Date:   Thu Aug 28 00:16:18 2014 +0200

    [TASK] Whitespace CGL fix