RecordLinkHandler extends AbstractLinkHandler implements LinkHandlerInterface, LinkParameterProviderInterface

FinalYes

This link handler allows linking to arbitrary database records.

They can be configured in addition to default core link handlers and are rendered as additional tab in the link browser.

A typical use case is linking a single new record.

Additional page TSconfig TCEMAIN.linkHandler setup is necessary to use this.

A typical configuration looks like the below snippet. It configures a tab that allows linking to ext:news news records ("table" is mandatory), labels them as "Book reports" (LLL: is possible), forces a specific page-uid (optional), and hides page-tree selection (optional).

TCEMAIN.linkHandler.bookreports { handler = TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler label = Book Reports configuration { table = tx_news_domain_model_news storagePid = 42 hidePageTree = 1 } }

Internal

This class is a specific LinkHandler implementation and is not part of the TYPO3's Core API.

Table of Contents

Interfaces

LinkHandlerInterface
Interface for link handlers displayed in the LinkBrowser.
LinkParameterProviderInterface

Properties

$configuration  : array<string|int, mixed>
Specific TSconfig for the current instance (corresponds to TCEMAIN.linkHandler.record.<identifier>.configuration)
$expandPage  : int
$iconFactory  : IconFactory
$identifier  : string
Configuration key in TSconfig TCEMAIN.linkHandler.<identifier>
$linkAttributes  : array<string|int, string>
Available additional link attributes
$linkBrowser  : AbstractLinkBrowserController
$linkParts  : array<string|int, mixed>
Parts of the current link
$pageRenderer  : PageRenderer
$updateSupported  : bool
$view  : ViewInterface

Methods

__construct()  : mixed
canHandleLink()  : bool
Checks if this is the right handler for the given link.
formatCurrentUrl()  : string
Formats information for the current record for HTML output.
getBodyTagAttributes()  : array<string|int, string>
Returns attributes for the body tag.
getLinkAttributes()  : array<string|int, mixed>
getScriptUrl()  : string
Returns the URL of the current script
getUrlParameters()  : array<string|int, string>
Returns all parameters needed to build a URL with all the necessary information.
initialize()  : mixed
isCurrentlySelectedItem()  : bool
Checks if the submitted page matches the current page.
isUpdateSupported()  : bool
Return TRUE if the handler supports to update a link.
modifyLinkAttributes()  : array<string|int, string>
render()  : string
Renders the link handler.
setView()  : void
getBackendUser()  : BackendUserAuthentication
getLanguageService()  : LanguageService
renderTableRecords()  : string
Render elements of configured table

Properties

$configuration

Specific TSconfig for the current instance (corresponds to TCEMAIN.linkHandler.record.<identifier>.configuration)

protected array<string|int, mixed> $configuration = []

$identifier

Configuration key in TSconfig TCEMAIN.linkHandler.<identifier>

protected string $identifier

$linkAttributes

Available additional link attributes

protected array<string|int, string> $linkAttributes = ['target', 'title', 'class', 'params', 'rel']

'rel' only works in RTE, still we have to declare support for it.

$linkParts

Parts of the current link

protected array<string|int, mixed> $linkParts = []

$updateSupported

protected bool $updateSupported = true

Methods

Checks if this is the right handler for the given link.

public canHandleLink(array<string|int, mixed> $linkParts) : bool

Also stores information locally about currently linked record.

Parameters
$linkParts : array<string|int, mixed>

Link parts as returned from TypoLinkCodecService

Return values
bool

formatCurrentUrl()

Formats information for the current record for HTML output.

public formatCurrentUrl() : string
Return values
string

getBodyTagAttributes()

Returns attributes for the body tag.

public getBodyTagAttributes() : array<string|int, string>
Return values
array<string|int, string>

Array of body-tag attributes

getLinkAttributes()

public getLinkAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getScriptUrl()

Returns the URL of the current script

public getScriptUrl() : string
Return values
string

getUrlParameters()

Returns all parameters needed to build a URL with all the necessary information.

public getUrlParameters(array<string|int, mixed> $values) : array<string|int, string>
Parameters
$values : array<string|int, mixed>

Array of values to include into the parameters or which might influence the parameters

Return values
array<string|int, string>

Array of parameters which have to be added to URLs

isCurrentlySelectedItem()

Checks if the submitted page matches the current page.

public isCurrentlySelectedItem(array<string|int, mixed> $values) : bool
Parameters
$values : array<string|int, mixed>

Values to be checked

Return values
bool

Returns TRUE if the given values match the currently selected item

isUpdateSupported()

Return TRUE if the handler supports to update a link.

public isUpdateSupported() : bool

This is useful for e.g. file or page links, when only attributes are changed.

Return values
bool

modifyLinkAttributes()

public modifyLinkAttributes(array<string|int, string> $fieldDefinitions) : array<string|int, string>
Parameters
$fieldDefinitions : array<string|int, string>

Array of link attribute field definitions

Return values
array<string|int, string>

render()

Renders the link handler.

public render(ServerRequestInterface $request) : string
Parameters
$request : ServerRequestInterface
Return values
string

renderTableRecords()

Render elements of configured table

protected renderTableRecords(ServerRequestInterface $request) : string
Parameters
$request : ServerRequestInterface
Return values
string

        
On this page

Search results