Feature #82738

LinkHandler viewhelper

Added by Guido S. about 3 years ago. Updated about 3 years ago.

Status:
Rejected
Priority:
Could have
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-10-11
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
linkhandler, typolink
Complexity:
easy
Sprint Focus:

Description

Hi,

we had following pseudo code:

<typolink>
linktext
svg icon
</typolink>

The svg icon should only showed up, if the typolink is an external url. Finally i build a simple viewhelper and use typo3 core functionality:

    public function render($link = '')
    {
        /** @var LinkService $linkService */
        $linkService = GeneralUtility::makeInstance(LinkService::class);
        $linkDetails = $linkService->resolve($link);

        return $linkDetails['type'];
    }

Maybe we could implementent these little viewhelper to the core?

Simple call

<f:link.linkhandler link="{link}" />

or inline

{f:link.linkhandler(link:'{link}')}
#1

Updated by Georg Ringer about 3 years ago

  • Status changed from New to Rejected

Thanks for creating this issue. However I don't see any sense in having this VH in the core. As you can have done it, this can be perfectly done with a custom VH or e.g. with JS or even with CSS: https://davidwalsh.name/external-links-css and hinding the svg via css.

Also available in: Atom PDF