Documentation · ViewHelper reference

XSD schema file | vhs master

Page / LinkViewHelper

Page: Link ViewHelper

Viewhelper for rendering page links

This viewhelper behaves identically to Fluid's link viewhelper except for it fetches the title of the provided page UID and inserts it as linktext if that is omitted. The link will not render at all if the requested page is not translated in the current language.

 Automatic linktext: <v:page.link pageUid="UID" />
 Manual linktext:    <v:page.link pageUid="UID">linktext</v:page.link>

/

  • Tag usage example

    <v:page.link class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL" showAccessProtected="1" classAccessProtected="'protected'" classAccessGranted="'access-granted'" useShortcutUid="1" useShortcutTarget="1" useShortcutData="1" target="NULL" rel="NULL" pageUid="123" additionalParams="{foo: 'bar'}" pageType="123" noCache="1" noCacheHash="1" section="''" linkAccessRestrictedPages="1" absolute="1" addQueryString="1" argumentsToBeExcludedFromQueryString="{foo: 'bar'}" titleFields="'nav_title,title'" pageTitleAs="NULL">
    	<!-- tag content - may be ignored! -->
    </v:page.link>
  • Inline usage example

    {v:page.link(class: 'NULL', dir: 'NULL', id: 'NULL', lang: 'NULL', style: 'NULL', title: 'NULL', accesskey: 'NULL', tabindex: 123, onclick: 'NULL', showAccessProtected: 1, classAccessProtected: ''protected'', classAccessGranted: ''access-granted'', useShortcutUid: 1, useShortcutTarget: 1, useShortcutData: 1, target: 'NULL', rel: 'NULL', pageUid: 123, additionalParams: {foo: 'bar'}, pageType: 123, noCache: 1, noCacheHash: 1, section: '''', linkAccessRestrictedPages: 1, absolute: 1, addQueryString: 1, argumentsToBeExcludedFromQueryString: {foo: 'bar'}, titleFields: ''nav_title,title'', pageTitleAs: 'NULL')}

Arguments

Argument Description Type
absolute

When TRUE, the URI of the rendered link is absolute

boolean
accesskey

Keyboard shortcut to access this element

string
addQueryString

When TRUE, the current query parameters will be kept in the URI

boolean
additionalParams

Query parameters to be attached to the resulting URI

array
argumentsToBeExcludedFromQueryString

Arguments to be removed from the URI. Only active if $addQueryString = TRUE

array
class

CSS class(es) for this element

string
classAccessGranted

Optional class name to add to links which are access protected but access is actually granted

string
classAccessProtected

Optional class name to add to links which are access protected

string
dir

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

string
id

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

string
lang

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

string
linkAccessRestrictedPages

DEPRECATED: Use showAccessProtected instead.

boolean
noCache

When TRUE disables caching for the target page. You should not need this.

boolean
noCacheHash

When TRUE supresses the cHash query parameter created by TypoLink. You should not need this.

boolean
onclick

JavaScript evaluated for the onclick event

string
pageTitleAs

When rendering child content, supplies page title as variable.

string
pageType

Type of the target page. See typolink.parameter

integer
pageUid

UID of the page to create the link and fetch the title for.

integer
rel

Specifies the relationship between the current document and the linked document

string
section

The anchor to be added to the URI

string
showAccessProtected

If TRUE links to access protected pages are always rendered regardless of user login status

boolean
style

Individual CSS styles for this element

string
tabindex

Specifies the tab order of this element

integer
target

Target of link

string
title

Tooltip text of element

string
titleFields

CSV list of fields to use as link label - default is "navtitle,title", change to for example "txmyextsomefield,subtitle,navtitle,title". The first field that contains text will be used. Field value resolved AFTER page field overlays.

string
useShortcutData

Shortcut to set useShortcutTarget and useShortcutData simultaneously

boolean
useShortcutTarget

Optional param for using shortcut target instead of shortcut itself for current link

boolean
useShortcutUid

If TRUE, substitutes the link UID of a shortcut with the target page UID (and thus avoiding redirects) but does not change other data - which is done by using useShortcutData.

boolean
Required attribute

Revision history

commit 096c6faeb504978d61f3ca835ab0900eadd3690c
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sat Jun 29 08:44:23 2013 +0200

    [FEATURE] Add page link ViewHelper
    
    This ViewHelper is an alternative to <f:page.link /> that fetches the linked page title and inserts it as link text as proposed in #240.

commit 7a34a016dc18585150f7d322d3862d63c592f8f2
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sat Jun 29 08:56:11 2013 +0200

    [TASK] Respect hideNotTranslated setting

commit 89fccdf29235382d2752a73ff21dee3068b3567e
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sat Jun 29 10:10:12 2013 +0200

    [TASK] Add titleFields argument

commit 19b13458a51902303615953249b12de7d6dc48f0
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sat Jun 29 10:13:32 2013 +0200

    [DOC] Correct return value description

commit 549b48c02c7e41ca3f0ab23a95adf8e99732ff27
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sun Jun 30 10:54:19 2013 +0200

    [TASK] Make use of registerArguments to improve legibility

commit 2310a2449452cb22ac89899c681fd7c7bfa89c80
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sun Jun 30 11:00:03 2013 +0200

    [TASK] Use proper string concatenation to reduce line lengths

commit 980bafc94352fc5af42605edded584ac1624a271
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sun Jun 30 12:48:59 2013 +0200

    [TASK] Adhere coding guidelines

commit c1a228a76410077b8f562c935af201c5e46411e2
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Thu Jul 11 13:51:33 2013 +0200

    [FEATURE] Enable renderChildren() to override linktext

commit 26d4fed4f6a89276d9b7d17f4ba5aa4e179ec006
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sat Aug 17 09:45:37 2013 +0200

    [FEATURE] Implement parsing of additional parameters

commit 25f28a263dfa3c0fc6b1465ec8354ff514e38dd4
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Sat Aug 17 10:21:38 2013 +0200

    [TASK] Respect viewhelper argument additionalParams

commit 6119283523c77b9d3d522d177961dca777b86e4c
Author: Cedric Ziel <*****@cedric-ziel.com>
Date:   Fri Dec 6 15:27:01 2013 +0100

    [BUGFIX] LinkViewHelper should respect tag-content in translations
    
    This fix postpones the title setting for sys_language_uid to the latest possible
    point to overcome a bug.
    Otherwise, the tag content wouldn't be taken into account when sys_language_uid != 0

commit 0c03d755dff70c4551cbc92b7c6910d358c43527
Author: Danilo Bürger <*****@hmspl.de>
Date:   Mon Dec 16 23:49:19 2013 +0100

    [FEATURE] Added pageTitleAs to page.link vh, clean up

commit f67ac7209036a38ec75ac519b33132c2e2ecdf23
Author: Danilo Bürger <*****@hmspl.de>
Date:   Tue Dec 24 09:34:19 2013 +0100

    [BUGFIX] Added link wizard links back in

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

    [TASK] Happy new year!

commit d2e531da034976e6db1478eef5a8478595fd16fe
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Jan 5 00:45:10 2014 +0100

    [TASK] Migrate to using namespace core class names

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 d491c330325cb5b7caea2e431b487d42c10de4b9
Author: Claus Due <*****@namelesscoder.net>
Date:   Thu Oct 16 21:53:03 2014 +0200

    [TASK] Cover some of Page / Link ViewHelper with tests

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

    [TASK] Reference Copyright to license.md file