Documentation · ViewHelper reference

Widget / LinkViewHelper


A view helper for creating Links to extbase actions within widets.

Examples

URI to the show-action of the current controller

<f:widget.link action="show">link</f:widget.link>

Output

link
(depending on the current page, widget and your TS configuration)

  • Tag usage example

    <f:widget.link additionalAttributes="{foo: 'bar'}" data="{foo: 'bar'}" action="NULL" arguments="{foo: 'bar'}" section="''" format="''" ajax="1" class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL" name="NULL" rel="NULL" rev="NULL" target="NULL" addQueryStringMethod="NULL">
    	<!-- tag content - may be ignored! -->
    </f:widget.link>
  • Inline usage example

    {f:widget.link(additionalAttributes: {foo: 'bar'}, data: {foo: 'bar'}, action: 'NULL', arguments: {foo: 'bar'}, section: '''', format: '''', ajax: 1, class: 'NULL', dir: 'NULL', id: 'NULL', lang: 'NULL', style: 'NULL', title: 'NULL', accesskey: 'NULL', tabindex: 123, onclick: 'NULL', name: 'NULL', rel: 'NULL', rev: 'NULL', target: 'NULL', addQueryStringMethod: 'NULL')}

Arguments

Argument Description Type
accesskey

Keyboard shortcut to access this element

string
action

Target action

string
addQueryStringMethod

Method to be used for query string

string
additionalAttributes

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

array
ajax

TRUE if the URI should be to an AJAX widget, FALSE otherwise.

boolean
arguments

Arguments

array
class

CSS class(es) for this element

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
format

The requested format, e.g. ".html

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
name

Specifies the name of an anchor

string
onclick

JavaScript evaluated for the onclick event

string
rel

Specifies the relationship between the current document and the linked document

string
rev

Specifies the relationship between the linked document and the current document

string
section

The anchor to be added to the URI

string
style

Individual CSS styles for this element

string
tabindex

Specifies the tab order of this element

integer
target

Specifies where to open the linked document

string
title

Tooltip text of element

string
Required attribute

Revision history

commit 4f857a2e5f7675ca5aaaf193936c62f2fb22f615
Author: Sebastian Kurfürst <*****@typo3.org>
Date:   Tue Nov 16 11:03:19 2010 +0000

    [!!!][TASK] Fluid (ViewHelpers): Rename widget link ViewHelpers
    
    Renaming Widget link ViewHelpers from
    <f:link.widget> and <f:uri.widget> to
    <f:widget.link> and <f:widget.uri>

commit 472451987ca0530fa5828bb0b79fcafa2f905a35
Author: Bastian Waidelich <*****@typo3.org>
Date:   Fri Nov 19 20:58:09 2010 +0000

    [-TASK] Fluid: R*****@scope annotations as they are not used in v4

commit c14e2ced03182567452157592b3db82cab941b3a
Author: Bastian Waidelich <*****@typo3.org>
Date:   Sat Nov 27 11:38:14 2010 +0000

    [+BUGFIX] Fluid (ViewHelpers/Widget): widget.link and widget.uri no create relative URLs
    
    This fixes: #11101

commit dd8928aed4c119d8db37322acb91ded24ba5cc35
Author: Bastian Waidelich <*****@typo3.org>
Date:   Thu Dec 30 16:21:11 2010 +0000

    [+TASK] Fluid (ViewHelpers): Fix, cleanup and extend inline documentation of ViewHelpers
    
    Resolves #10908

commit b3637985e7ebb34dd12d6181b214ae5ce4b70f54
Author: Bastian Waidelich <*****@typo3.org>
Date:   Thu Jul 28 17:01:44 2011 +0200

    [!!!][FEATURE] Compilation of Fluid templates to PHP files
    
    This adds a compile step to the parsing process of templates, layouts and
    partials.
    If no compiled cache file exists, Fluid will create it while parsing the
    respective Fluid template.
    The cache file is invalidated as soon as the template/layout/partial
    has been modified (or if caches are flushed).
    This speeds up the rendering process by factor 2-5!
    
    Breaking change:
    
    * AbstractViewHelper::$arguments are no longer an object but an array.
      If you used $this->arguments->hasArgument() in your custom ViewHelpers,
      you'll have to replace this with $this->hasArgument()
    
    Change-Id: Idb71f85ea7223755df4bc1c0ff9f8807f1924323
    Related: #28544
    Resolves: #28545

commit fd09d197fa8886b97cb20aa9573f39cd08ce989e
Author: Bastian Waidelich <*****@typo3.org>
Date:   Thu Nov 10 18:27:58 2011 +0100

    [TASK] S*****@author annotations
    
    This backports three recent changes of the TYPO3.Fluid package:
    - R*****@license annotation from files (290f4f5)
    - Simplify license header in PHP files (14bacba)
    - D*****@author tags from source code (9c2e837)
    
    This should not contain any functional change!
    
    Change-Id: I9376dca4af78c4f0f82413011d115b8ad04634dd

commit ec3891d8d4e339d8319428211207e6201be9fd73
Author: Thomas Maroschik <*****@dfau.de>
Date:   Wed Oct 17 21:18:26 2012 +0200

    [TASK][WIP] Move non class code back to source files
    
    Change-Id: I620d2e61860142cdc89cc83474c95542799961c0

commit 554e8f890dcc0dd86a27518b58e2b54be26fd37e
Author: Thomas Maroschik <*****@dfau.de>
Date:   Wed Oct 17 22:20:17 2012 +0200

    [TASK] Namespace classes
    
    Change-Id: Ia7432e1c923826ed58206bca15fb94509adbd508

commit 9d13dedf017b614b834261b1bf5d4acb2201f1d4
Author: Alexander Schnitzler <*****@typovision.de>
Date:   Fri Nov 16 19:49:02 2012 +0100

    [CLEANUP] Replace FLOW3 with TYPO3 Flow
    
    Releases: 6.0
    Fixes: #43036
    Change-Id: I62df23587301b4cde3ddeae3686b34f54fe1182e
    Reviewed-on: http://review.typo3.org/16498
    Reviewed-by: Alexander Schnitzler
    Tested-by: Alexander Schnitzler

commit 9d46e6932d35c79bf87c96fa38b8e537c4192f23
Author: Alexander Schnitzler <*****@typovision.de>
Date:   Tue Nov 20 16:27:02 2012 +0100

    [CLEANUP] Adjust code to CGL and fix small namespace bugs
    
    * whitespaces, tabs and blank line issues
    * bool -> boolean
    * int -> integer
    * fix wrong namespace annotations
    
    Fixes: #43157
    Releases: 6.0
    Change-Id: I8397948e19248db029d8efd1555ee56e4982742d
    Reviewed-on: http://review.typo3.org/16619
    Reviewed-by: Helmut Hummel
    Tested-by: Helmut Hummel

commit 77f29a3c69a7cbb27b34072754aa503bace6c9f1
Author: Christian Kuhn <*****@schwarzbu.ch>
Date:   Tue Oct 1 14:40:56 2013 +0200

    [TASK] Remove closing PHP tags
    
    Change-Id: Iaa92566c53301e49396fc9fb26b0b339c48d567b
    Resolves: #52360
    Releases: 6.2
    Reviewed-on: https://review.typo3.org/24212
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn
    Reviewed-by: Ernesto Baschny
    Tested-by: Ernesto Baschny
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring

commit c5b84cd8a3d26aa4c42dbdf10c80883010cc44ce
Author: Stanislas Rolland <*****@sjbr.ca>
Date:   Fri Jul 19 15:31:09 2013 -0400

    [FEATURE] uriBuilder should honor POST arguments for addQueryString
    
    Currently the addQueryString option in the uriBuilder only supports
    arguments which are in the query string. Therefore, the pagination
    widget does not work with filtering post requests.
    
    Solution: Add addQueryStringMethod (already supported by typolink
    configuration) as property of uriBuilder and as argument of the
    following fluid view helpers:
    * link.action
    * link.page
    * uri.action
    * uri.page
    * widget.link
    * widget.uri
    * widget.pagination
    Add addQueryStringMethod as configuration option of the paginate widget.
    
    Fixes: #35281
    Fixes: #11441
    Releases: 6.2
    Change-Id: I8f2963fa7467dffcf3b9535d2a41820de8f9930a
    Reviewed-on: https://review.typo3.org/22432
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring
    Reviewed-by: Stefano Cecere
    Reviewed-by: Stefan Neufeind
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn