LinkHandlerInterface

Interface for link handlers displayed in the LinkBrowser.

Link handlers are used when the global "link" modal is rendered: When linking an RTE text snipped to something, and for fields like "header_link" in table "tt_content".

A link handler is a tab in the link modal.

Link handlers are configured with page TSconfig TCEMAIN.linkHandler - each tab is a sub-key in this area. The core configures a couple of default link handlers like linking to a page, a mail, telephone and similar.

Link handlers create a TYPO3 specific URI prefixed with 't3://' managed by ext:core LinkHandling classes. The frontend translates this to appropriate HTML using the ext:frontend Typolink classes.

Table of Contents

Methods

canHandleLink()  : bool
Checks if this is the handler for the given link
formatCurrentUrl()  : string
Format the current link for HTML output
getBodyTagAttributes()  : string[]
getLinkAttributes()  : array
initialize()  : mixed
Initialize the handler
isUpdateSupported()  : bool
Return TRUE if the handler supports to update a link.
modifyLinkAttributes()  : string[]
render()  : string
Render the link handler. Ideally this modifies the view, but it can also render content directly.

Methods

Checks if this is the handler for the given link

public canHandleLink(array $linkParts) : bool

The handler may store this information locally for later usage.

Parameters
$linkParts : array

Link parts as returned from TypoLinkCodecService

Return values
bool

formatCurrentUrl()

Format the current link for HTML output

public formatCurrentUrl() : string
Return values
string

getBodyTagAttributes()

public getBodyTagAttributes() : string[]
Return values
string[] —

Array of body-tag attributes

getLinkAttributes()

public getLinkAttributes() : array
Return values
array

isUpdateSupported()

Return TRUE if the handler supports to update a link.

public isUpdateSupported() : bool

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

Return values
bool

modifyLinkAttributes()

public modifyLinkAttributes(string[] $fieldDefinitions) : string[]
Parameters
$fieldDefinitions : string[]

Array of link attribute field definitions

Return values
string[]

render()

Render the link handler. Ideally this modifies the view, but it can also render content directly.

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

Search results