[TYPO3-mvc] Typolink extbase fluid

Matt Janus janus76uk at googlemail.com
Tue Nov 29 14:39:57 CET 2011


Hi Georg,

Thanks for this. I have taken your advice and implemented this as a viewHelper.

All the best

Matt

On Mon, Nov 28, 2011 at 6:12 AM, Georg Ringer <typo3 at ringerge.org> wrote:
> Hi,
>
> Am 25.11.2011 17:18, schrieb Matt Janus:
>
>> Thanks for all your help and guidance with this!!
>>
>> I was still having issues getting external links to open in a new
>> window/tab. I did a bit of hunting around and came across an idea in
>> another post. This was to use conditions to kind of evaluate if the
>> link was a number i.e less than 10000 (my site has way less pages!!).
>
>
> don't do such things, there are so many headaches I got with it (you can't
> use this template in other systems and so on).
>
> A way how I did it in projects:
> Link is set in BE using the wizard and therefore the editor can set the
> target there on his own and the field contains something like 123 _blank.
>
> so all i did is this viewhelper:
> -------------
> class Tx_FoBanner_ViewHelpers_TargetLinkViewHelper extends
> Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
>
>        /**
>         * @param string $link
>         */
>        public function render($link) {
>                return (strpos($link, ' _blank') === FALSE) ? '' : '_blank';
>        }
> }
> ---------------
>
>
> and called it in the template
> ---------
> <f:link.page pageUid="{teaser.link}"
> target="{bv:targetLink(link:teaser.link)}">
> ---------
>
> georg
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list