In Wordpress/Contao is the option to insert shortcodes/inserttags into text fields.
For example, if you want to insert a dynamic date into some text, you can just write Foo {{date::Y}} bar.
This would be live converted in the frontend to Foo 2017 bar.
Developers are able to write own PHP code for such Shortcodes.
Neos uses so called “ViewHelpers” that you can use. Have a look at the templates of the Neos.Neos package and the corresponding classes (in Classes/ViewHelpers). If you have questions, just ask. There are already many ViewHelpers built-in.
There is no real API for short codes, but you can pretty easily create a custom processor that is applied via Fusion:
<?php
namespace Your\Package;
use Neos\Fusion\FusionObjects\AbstractFusionObject;
final class ConvertShortCodeImplementation extends AbstractFusionObject
{
/**
* @return string
*/
public function evaluate()
{
$text = $this->fusionValue('value');
return str_replace('{{date::Y}}', (new \DateTime())->format('Y'), $text);
}
}
Example: add it to all content elements when not in backend
Like this the short codes would be displayed as-is in Backend and converted when rendered in FE. If you want to convert them in the Backend as well you can omit the last @if condition.
Note: The result of your conversion will be cached along with the corresponding node