Adding javascript: in href using TYPO3 RTE

The link wizard is a great tool for normal TYPO3 user to add link (internal, external, or email link). But what if a javascript function needs to be triggered manually by clicking a link? you can make an onClick event listener to achieve this. But in RTE you can also adds javascript:someFunction(); as href parameter.

To do this, switch to text mode in RTE by clicking the <> button and put your link manually. Following parameters need to be added manually:

so should the link looks like

Automatically apply PSR-2 coding style

*UPDATE*

In version 2 of php_cs_fixer some parameters and rules are renamed. Upgrade guide can be see on their Github page. This how-to is accordingly updated.


Applying PSR-2 coding style manually is really no fun and wasting time. A short visit in Github and there’s a tool which detects and fixes the coding style. The tool is called php-cs-fixer.

I’ll show you how to get the tool and use it to easily reformat all PHP file in project.

Continue reading Automatically apply PSR-2 coding style

Fail downloading file on Android

How hard is it, to write a PHP script to allow user to download a file? really easy, one would say. Just send the appropriate HTTP header and echo the file content.

Basically that’s all I need to force download per PHP. But somehow Android stock browser (Chrome) only downloads and creates a 0 kB file. Other browser (tested with Firefox on Android) saves the file correctly.

What does happen here?

Continue reading Fail downloading file on Android

Extbase and RealURL

another day, another problem. Extbase is becoming main framework for TYPO3 extension, because it’s really easy to create a frontend plugin to show (listing or detail view) of a records. Since it’s MVC framework, Extbase create a complex URL for each record.


http://domain.tld/pageName/?tx_extension_plugin[action]=show&tx_extension_plugin[controller]=controllerName&tx_extension_pluginName[param]=9

how to short this?

Continue reading Extbase and RealURL

Standalone view in extbase

Usually a view in extbase is always called from a controller.  but what if, an action in your controller is called as an eID and only parts of the template needs to be rendered? Partial is an option, but I have a code snippet, which uses the

class.

Continue reading Standalone view in extbase

add class to link in RTE

It’s might be a simple problem, but yet it’s really hard to find the correct solution. Although the solution is a simple one.

Using any of the CSS frameworks out there, you can easily create a button, even from a link, just by adding a class. The problem is, how you can put this class in RTE, so that the editor can easily choose which button class should be used.

Continue reading add class to link in RTE

#t3cm14 #goodies.. It’s pink :)

via Instagram http://ift.tt/YjYhcz