Exercise with extbase and Ajax

25 July 2014 Comments Off


This example is a dummy problem, which aims to create a basis for explaining the use of 3 concepts: format parameter, StandaloneView and PHP based views. The solution works with TYPO3 version >= 6.0

The problem

Let’s suppose that we need to implement the following task: we have a page that looks, at load, like in the below model:

Box C

When clicking on the link “Show Items” from box A, 2 new boxes (D & E) should be loaded, without page refresh (ajax call)

Box E


We will assume that Box D and Box E display the same records, let’s call them Items. Let’s also consider that Box D and Box E need to be templatable. As we can’t include the both boxes in the same Fluid template, due to the page layout, we need 2 different Fluid templates, one for each box. As they display the same records, for performance reasons, we can load them using a single ajax call, which will return a JSON object with 2 attributes, having as values the HTML for Box D and the HTML for BOX E. On clicking the title of the Item, the user will be redirected to a page displaying the details of the item.


Let’s call the extension test_extension, the controller Test.We will need:
an action to return the JSON, let’s call it ajax,
an action to display the detail (single) page of the item, let’s call it show
let’s consider we would also need an action to display the “Show items” link (although in the current example this is not necessary), let’s call it tease

So we need to resolve 2 issues: 1. the ajax call should return a JSON and 2. the ajax action should parse 2 different templates.

1. The ajax call should return a JSON

Let’s suppose we registered the plugin in ext_localconf.php with the name Test:

Arxia.’ . $_EXTKEY,
Test=> ajax,show,tease,

The most convenable solution to handle this ajax request is using typenum (typenum allows to create different versions of the same page, accessible by adding the type GET/POST parameter in the url of the page). So we need to configure a new version of the site (let’s choose typenum 121) in the test_extension/Configuration/Typoscript/setup.txt file.

My favorite way of including a plugin through Typoscript is to actually select a content (tt_content). A container page may be used to add the content. This is my favorite way because we will have access to all the configurations of the plugin’s flexform – that will allow to an advanced editor to easily change some parameters, like the page which contains the records.

testPage = PAGE
testPage.typeNum = 121
testPage.config.disableAllHeaderCode = 1
testPage.config.additionalHeaders = Content-type:application/json
testPage.config.xhtml_cleaning = 0
testPage.10 = CONTENT
table = tt_content

# a content of type plugin, will have in the list_type field a value which will respect the following format
# <extensionname>_<plugin_name>, in lowercase; if the extension name has “_” they will be ignored;
# as we registered the plugin Test in ext_localconf.php, the list_type value will be “testextension_test”;
# adding the below condition, we ensure that no undesired content is selected
select.andWhere = list_type = “testextension_test”
select.pidInList = <the container page id>

renderObj < tt_content

# below we remove tt_content default wrapping
# and preserve only the plugin output
renderObj.stdWrap >
renderObj.list.10 >
renderObj.list.20.stdWrap >


Although we can simply return the JSON from the action, let’s return it from a view, as, in real life, some output related decisions may be managed from the view. But as we may need the PHP power inside the view, we are going to use a PHP based view. This type of view use pure PHP to generate the output.

We need to add the file corresponding the view in the folder <extension>/Classes/View/<ControllerName>. The file name should follow the naming convention <Action><Format>.php. We need the format to be JSON, so the path for our file should be “test_extension/Classes/View/Test/AjaxJson.php”.

The view should extend TYPO3\CMS\Extbase\Mvc\View\AbstractView (which implements the interface TYPO3\CMS\Extbase\Mvc\View\ViewInterface) and it should implement the method render. Let’s consider that we will assign to the view, from the ajax action, 2 variables: boxAContent and boxBContent. We will retrieve them as keys of the variables attribute of the view. The content of our view file will be:

namespace Arxia\TestExtension\View\Test;

class AjaxJson extends \TYPO3\CMS\Extbase\Mvc\View\AbstractView {

public function render() {
$jsonArray = array(
‘boxAContent’ => $this->variables['boxAContent'],
‘boxBContent’ => $this->variables['boxBContent']
return json_encode($jsonArray);

However, we need to tell extbase the request is in JSON format, in order to correctly recognize the view. We can do this using the less known parameter: format. Also let’s suppose we want to cache the JSON response (as any other page would be cached). We will create the link to “Show items” in Box A. As this is outputted by the tease action, we also have a corresponding view, which should contain the following code:

<f:link.action action=”ajax” controller=”Test” format=”json” pageType=”121″>
<f:translate key=”LLL:EXT:test_extension/Resources/Private/Language/locallang_db.xlf:show_items” />

The parameter format will add tx_testextension_test[format]=json, which will tell extbase that the request is using JSON format. After we have this link, we can use Javascript to change the normal navigation when clicking the link with an ajax request.

2. The ajax action should parse 2 different templates (Fluid files)

In order to parse from an action 2 different Fluid files, we will need to use a special view provided by extbase: TYPO3\CMS\Fluid\View\StandaloneView. We will create in Test controller a protected function which also assign to the specific template some variables. Let’s consider we added the Fluid files in Partial folder, as they may be used in other FLUID views.

protected function renderFileTemplate($templateFile, $variables) {
$view = $this->objectManager->get(‘TYPO3\\CMS\\Fluid\\View\\StandaloneView’);


$extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);

// generate the template path
$relativeTemplateFilePath = $extbaseFrameworkConfiguration['view']['partialRootPath'] . $this->request->getControllerName() . ‘/’ . $templateFile;
$absoluteTemplateFilePath = TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($relativeTemplateFilePath);

// asign variables to the template

return $view->render();

The ajax action will call this function 2 times and it will assign the result of the 2 parsed templates to the PHP based view

public function ajaxAction() {
$items = $this->itemRepository->findAll();

// generate Box A
$boxATemplate = ‘BoxA.html’;
$variables = array(‘items’ => $items);
$boxAContent = $this->renderFileTemplate($boxATemplate, $variables));
$this->view->assign(‘boxAContent’, $boxAContent);

// generate Box B
$boxBTemplate = ‘BoxB.html’;
$variables = array(‘items’ => $items);
$boxAContent = $this->renderFileTemplate($boxATemplate, $variables));
$this->view->assign(‘boxBContent’, $boxBContent);

Final thoughts
Although the above example is just a dummy problem, all of the 3 concepts may be used in various real problems. An example of a real-life problem solved by StandaloneView can be found here: forge.typo3.org: How to use the Fluid Standalone view to render template based emails

Other useful links are:

Most of the comments code were removed in order to save space.


Author: Alina Fleşer

TYPO3 Neos – Ready for production?

30 June 2014 Comments Off

TYPO3 Neos logo

TYPO3 Neos is the next-generation open source content management system made by the TYPO3 community. Neos is based on the PHP framework TYPO3 Flow.
There was & still is a lot of hype lately around the new TYPO3 product, TYPO3 Neos, that makes many people ask one simple question: Is TYPO3 Neos ready for production? For different clients, with different needs, for “impossible” projects?
Many TYPO3 agencies ask if Neos is ready for production. We will try to answer, from our direct experience gathered while implementing several Neos projects

TYPO3 Neos hands on - Case Study #1

Naturally, we were excited when we saw the first opportunity to propose TYPO3 Neos as a solution for a small local institution that had an old website on a deprecated platform. The reason we chose to go with TYPO3 Neos was a combination of eagerness to try it on a real world project and also because it really fit well with the needs of our client. Our client’s editors were people who weren’t technical at all, people from the medical sector. TYPO3 Neos is a perfect candidate for simple editor:

  1. Simple editing method
  2. Short learning period
  3. No training required
  4. Intuitive use

Having experience with TYPO3 Flow was also a factor when we made the decision for TYPO3 Neos because the CMS itself is no more than a TYPO3 Flow application.

TYPO3 Neos 1.0 was the starting point for us and during the development we saw how easy custom elements can be created with the power of nodes & TypoScript 2.0. But what hurt us the most was the acute lack of documentation. Finding the right documentation was not a matter of looking into wikis, but mailing lists or even IRC chats on Freenode channel #typo3-neos
That can be really frustrating, but with lots of coffee & patience that can be overcome.

The project didn’t hit us with any surprises and development went really smooth despite that fact that it was a new CMS for everyone involved in the team. Version 1.0 was buggy especially in the backend, problems usually occurred with the editing of content, most of the times exception were thrown if the user deleted content in some cases.
After delivery we were surprised that the client didn’t need any training, everything was so intuitive for him that content was added by editors without any help / training from our side. Impressive.

TYPO3 Neos hands on - Case Study #2

Another project that came to us as a explicit request for TYPO3 Neos, gave us the opportunity to test drive the freshly released TYPO3 Neos 1.1. We must say that the Neos team did a great job making a more stable version, problems that usually occurred in backend were fixed and a great improvement in performance was very welcomed. Also, some new minor features were introduced, like node type switching, which was badly needed for editors.

But the localization & translation are still missing from the backend, although the foundation was set already in 1.1. For now, the easiest way to do multilingual websites with TYPO3 Neos is to use the old fashion way that was used also early on in TYPO3 CMS, different page trees for each language. The TYPO3 Neos team promises to deliver Content Dimensions, an alternative to the translation handling that currently exists in TYPO3 CMS. The content dimension concept is the foundation to work with different content variants and have a very flexible localization solution in Neos. The user interface to work with content dimensions and translations will be part of the next version (1.2).
For example, you can have more than languages, you could make variants of a content element for people ages 13 -25 and other variants for people ages 26 +. This cool features will help websites present relevant information not only by language, but also depending on the website user characteristics.

Getting back to our project, integration of template was easy and even if the website was multilanguage we managed to get by the missing translations infrastructure quite easily.
Since the website was responsive, we needed to target different devices and here our experience with Flow / Fluid kicked in. This is one of the advantages of TYPO3 Neos for agencies that are working with Extbase / Fluid / Flow is that even if they never touched it, it will feel familiar and custom plugins will be no more than simple packages. But most of the time you won’t need dedicated plugins, like extensions in TYPO3 CMS. Nodes & Fluid are extremely flexible that in most cases you won’t need a plugin.

TYPO3 Neos & Deployment

Another aspect that we love about TYPO3 Neos is deployment. Having from the start each website as a Flow package is just awesome, during development and also after. Working with a team under VCS is extremely easy and once you are done, all the content can be exported into a single XML file. No database dumps, we just installed a fresh Neos on the clients server and installed the package, et voila! Everything was working perfectly.

Production ready can have different meanings for different people, but some key factors are still missing:

  1. Translation / localization
  2. Multi domain support
  3. Documentation

Once all the above are stable and in good shape, we can state that TYPO3 Neos is indeed production ready.


TYPO3 Neos is already good for small presentation websites, we are glad to see how easy the inexperienced editors get to manage the content with Neos and we believe that given time it will have a bright future.

We believe in the power & concepts that TYPO3 Neos brings to the CMS market and with the new skills we acquired, we are ready to deliver TYPO3 Neos projects!

Author: Tomita Militaru


Arxia at T3DD14 in Eindhoven

23 June 2014 Comments Off

We’ve just returned from the TYPO3 Developer Days held in Eindhoven the Netherlands. The T3DD is one of the most important events in the TYPO3 Universe gathering together more then 200 developers from different countries and continents. It’s the place where you can meet almost all the core developers of TYPO3, TYPO3 Neos and TYPO3 Flow. Our team was represented by László Bodor and Tomiţă Militaru, both TYPO3 integrators and extension developers.

Tomi and Laci

Although not there physically, our colleagues Alina Fleşer and Daniel Homorodean were also there in pictures (see below)

Alina and Daniel

The event started on Thursday 19th of June with an opening speech from Patrick Broens followed by Ben van’t Ende and Olivier Dobberkau. The opening session featured an interesting community building moment. Ten veteran TYPO3 people become so called buddies of 10 newcomers into the TYPO3 world, it’s an interesting idea and it will probably help the newcomers to integrate into the TYPO3 community more easier.

After the opening ceremony the workshops kickstarted in full force in the different rooms of the TechniekHuys. Even from the first day it was obvious that there is a very big interest in subjects related to TYPO3 Neos (full rooms at almost every Neos related workshop). Due to the nature of the T3DD (having several parallel tracks) we could attend only a limited number of workshops but from what we’ve seen there was quite some number of interesting workshops. The true value of the T3DD is that these workshops are held by people who actually created that feature, extension or product. This way the attendees can direct their questions directly to the developer and can get a qualified opinion on the subject. The first day ended with the the lunch and some socializing.

Friday I’ve attended the THEMES workshops and Tomiţă went to the Flow/ Neos contribution workshop. The THEMES project aims to bring interchangeable themes to the TYPO3 world just like other CMS’s do so and this is a subject i was always interested in. The workshop held by Kay Strobach, Jo Hasenau and Thomas Deuling presented the progress of the project so far. And then we’ve even created a theme in the second part of the workshop based on the bootstrap package done by the developers. When the themes extension will be mature enough and a distribution will be available with some prepackaged themes and extensions it will be much easier for newcomers to kickstart their website with TYPO3 and some themes. The second day ended with the coding night where people could work on different bugs and features from within the TYPO3 family of products (TYPO3, Neos, Flow) and extensions.

Photo credits: R. Kuthe – @mixedpixel

On the 3rd day it was Flow / Neos time for us. First the Flow beginner workshop with Robert Lemke – although I’m not really a beginner anymore but i attended to pick up maybe some new things or best practices. Then in the afternoon we’ve attended the TYPO3 Neos Advanced integration workshop held by Christian Müller and Sebastian Kurfürst. This night was the social event night which started with a barbeque just outside of the TechniekHuys and then continued with the soccer game Germany – Ghana projected on a big screen. Unfortunately for the audience Germany only managed a draw 2-2 with Ghana. Remains to be seen who will be the winner of group G on Thursday when Germany meets the USA. Of course the social event wasn’t just about the game, there were lots of discussions, beer, wine and whatnot.

Unfortunately for us we had to leave after this night because on Sunday morning we’ve had our plane back. We have to thanks to the organizers for this great event which gave us the opportunity to learn more, to meet nice people from the Netherlands, Germany and Poland. Also a big thank you for all the sponsors, especially jweiland.net , domainfactory, aoe and networkteam.

Greetings to all of you from Cluj Napoca – The heart of Transylvania and we hope to see you all at TYPO3 East Europe in 31 October / 1 November 2014.

Author: László Bodor

It’s time to upgrade to TYPO3 6.2 LTS

3 April 2014 Comments Off

As you probably know on the 25th of March the newest version of TYPO3 CMS has been released. Version 6.2 is a Long Term Support version, the second LTS released by the TYPO3 community and it will be supported until 2017. This release is focused on enterprises which use the 4.5 LTS version.

There are quite some new features in TYPO3 6.2, you can read all about those in the release notes or if you would want a more technical overview of the new features then you can look at the What’s new slides of the 6.2 version. The new features appeal for a broad user base: editors, integrators, administrators, developers and security specialists. We believe that these  new additions to the TYPO3 feature set along with the stability and performance improvements are a good reason to upgrade to version 6.2 LTS.


Upgrading from TYPO3 4.5 to TYPO3 6.2 

TYPO3 4.5 LTS is supported with security and stability fixes until March 2015. This gives roughly one year to current users of TYPO3 4.5 LTS to upgrade to TYPO3 6.2 LTS. The upgrade path is in most cases straightforward and smooth. There is also an extension called smoothmigration which will analyse your current setup, the installed extensions and configuration to check for features and functions which have been removed or changed during the update.

However in some cases changes will be required, either to configurations or existing extensions which are not compatible with TYPO3 6.2 LTS. During the last several months our team upgraded several websites from TYPO3 4.5 LTS to TYPO3 6.1 and we have begun the first upgrades to TYPO3 6.2 LTS. During our upgrades we encountered problems especially on custom 3rd party extensions which were not compatible with this newest TYPO3 release.

In light of the above we recommend our customers not to postpone the upgrades until the second part of the year because the March 2015 deadline will be very close and professional help will be scarce (as many people will be upgrading projects by then). And we can’t even imagine leaving your TYPO3 installation potentially vulnerable due to lack of updates after March 2015.

If you need help upgrading or you just want to evaluate how much effort is needed for upgrading your TYPO3 installation to 6.2 LTS then don’t hesitate to contact us.

AWS CloudFormation TYPO3 Introduction Package Template

21 October 2013 Comments Off

Hosting in the cloud becomes more and more a common practice, including for TYPO3 projects, and easy deployment is very important.  Amazon is one of the most popular providers and we had the opportunity to try it out for one of our projects.

AWS CloudFormation offers the possibility to create new instances using custom or existing configuration templates. For details about the AWS CloudFormation and the configuration templates use the following links: http://aws.amazon.com/cloudformation/aws-cloudformation-templates, http://aws.amazon.com/cloudformation.

As we did not find an existing template for TYPO3, we have made one, and as you can see further, it is actually quite simple to do that.

To create a new instance which downloads automaticaly the TYPO3 Introduction Package you have to:

  • - download the configuration file
  • - login to your amazon web service account
  • - go to the CloudFormation page
  • - create a new stack by uploading the TYPO3 Introduction Package template file
  • - specify the TYPO3 database name and the mysql acces to the database you need, the keyname for the ssh acces
  • - go to the last step, save and the new instance is ready

After you have created the instance, use the instance’s link into the browser, follow the steps to install the TYPO3 Introduction Package and the site will be ready to use.

The AWS CloudFormation template for the TYPO3 Introduction package contains the settings for:

  • - install the apache, mysql and php
  • - download the TYPO3 Introduction Package source from http://get.typo3.org/introduction
  • - unzip de code and copy the folders to /var/www/hml/
  • - create the ENABLE_INSTALL_TOOL file into the typo3conf folder
  • - add write access to the following folders:
    • - fileadmin
    • - typo3conf
    • - typo3temp
    • - uploads

You can download the template from here.

Author: Diana Precup

Certified TYPO3 Integrators at Arxia

30 January 2012 Comments Off

certificationLast December Arxia sponsored the 2nd TYPO3 Usergroup Romania Meetup. The event was a great success and was followed by the first ever TYPO3 Certification Event in Romania. The certification exam was conducted by officials of the TYPO3 Association.

Three of our colleagues registered for the Certification Event and participated in the exam. Today we received word that all 3 passed the exam. As a result in the Arxia team there are 3 Certified TYPO3 Integrators. So our congratulations go to:

  • Fleșer Alina
  • Bodor László
  • Militaru Tomiță

Arxia is as good as its people are, so that’s why we invest in trainings and certifications in order to be able to deliver quality services to our customers. Having three Certified TYPO3 Integrators is another important step and a guarantee of the quality of our work.

New TYPO3 version and security bulletin

27 July 2011 Comments Off

The TYPO3 Core Team just released new versions 4.3.12 , 4.4.9 and 4.5.4 of the TYPO3 Enterprise Content Management System.

logo-typo3These version are maintenance and bugfix versions as several bugs and security vulnerabilities were discovered in the TYPO3 core. These issues were also announced yesterday after the new versions were available. It is common practice that once these issues are discovered by the Core Team they are fixed and then announced after the patch version is available.

Because bugs and security issues are discovered from time to time in every software package, it is strongly recommended that users keep their TYPO3 version and also 3rd party extensions up to date in order to avoid their server being compromised

Arxia offers its customers a complementary service for a monthly fee that will ensure that the TYPO3 version and the used extensions are updated as soon as a patch is available. More details about this service will be available in a separate posting on this blog. Until then you can contact us anytime for more information.

Arxia is now a TYPO3 Association member

26 July 2011 Comments Off

Arxia – our company – develops projects using TYPO3 since 2005, being among the first companies in Romania to work with this Enterprise CMS. Since then we have delivered hundreds of projects with TYPO3 and trained many TYPO3 developers. We became the biggest TYPO3 company in Romania and we have been involved in some very large projects built with TYPO3 and delivered to customers in Romania and abroad (Germany, Netherlands, France).

During our work with TYPO3 it became natural for us to give back some things to the community and to the TYPO3 association. Among our actions in this direction is the TYPO3 Romania Usergroup – which is supported and hosted by Arxia. This usergroup allows Romanian TYPO3 developers to interact with each other and to find information on subjects that matter to them.

Another step in this direction is that from July 2011 we are Silver members of the TYPO3 Association. We hope that by being members will be able to support the TYPO3 Association more and that our contribution helps the development of TYPO3 in becoming the most successful Enterprise CMS on the market.


On the long term Arxia is committed to use TYPO3 and to offer it as the main solution to most of the projects in the enterprise segment. This is why is very important for us that the TYPO3 project goes forward and evolves permanently. Everyday there are new challenges, new technologies and new security issues in the IT business and we hope that by supporting TYPO3 (and the Association) we will make it ready for these challenges for the years to come.

The new TYPO3 4.4 is here!

23 June 2010 Comments Off

Yesterday the TYPO3 community released a new version of the popular TYPO3 Enterprise CMS. Version 4.4 brings many novelties! Among other things we noticed first the revamped backend look&feel which also has been optimized for faster loading so users will be able to do their tasks faster and easier.

Another great improvement is the revised Rich Text Editor which now completely relies on ExtJS allowing a much smoother and faster functioning of the editor.

Of course there are many other improvements aimed mainly for developers: The Introduction Package (a fully configured and functioning site out of the box when installing TYPO3), easier installation with the revamped Install Tool, Skinning API, revised Task Center and HTML5 support both in frontend and backend, Caching Framework improvements.

Arxia will begin to use TYPO34.4 with any new upcoming project as we already tested TYPO3 4.4 by the time it was in Beta state and we are confident that it will bring a significant added value to any project. We are also performing on-demand upgrades for our clients who want to implement the new version of TYPO3 for a faster and smoother content management.

If you want to upgrade your installation and need help we are glad to offer it. Just contact us and we will see how can we accomodate your request.

Post written by: Bodor László (Arxia TYPO3 Team)

CASE STUDY: Unica.ro – an online community for women powered by TYPO3

14 April 2010 Comments Off

Unica.ro is considered one of the major online projects of Ringier Romania. Currently among the top ten online portals focused on lifestyle in Romania, the website wants to gather a consistent and active community of women to which to offer relevant and up-to-date content.

Main requirements

Our customer approached us with the following list of main requirements:

1. Create an environment where the targeted segment (women) can find relevant content (news, photos and videos) displayed in an attractive format, highlighting the updates.

2. Create an active community, by stimulating the users activity and feedback (adding comments, casting votes, posting in the forum section, participating to surveys, use the internal messaging of the website, creating own albums, etc.). The users are enticed through a system which rewards active users with points.

4. Give and receive opinions to personal issues, by creating a section where the users can ask the feedback of the community about a certain problem (with a functionality similar to Yahoo! Answers).

5. Create a complex astrology section, where one can find the predictions for the current day or year and also can find the compatibility between signs.

Technical requirements

- Use of TYPO3 version 4.2 as a development framework and also as a backend.
- Due to short implementation time and to budget restrictions, public extensions were to be used wherever possible.
- Custom extensions would need to be built for the functionality where we couldn’t find suitable public extensions.
- AJAX technology would be used in order to create a smooth user experience through the interface.

Technical challenges and solutions

1. Implementation using public extensions with respect to the TYPO3 CGL.

Taking into consideration that certain public extensions do not implement TYPO3′s extending methods (for example cwt_community does not use HOOKS or XCLASS) or, in other cases, the separation between the PHP and HTML code is not done at acceptable standards (for example simplesurvey), we have decided to create new extensions, based on the code and logic of some public ones but modified in order to implement the project’s specifications and in the same time apply to the TYPO3 CGL.

2. Using AJAX technology combined with some public extensions that are not implemented using it.

As an example, we’ve used AJAX for adding, replying and browsing the users commentaries of the articles. Originally, this functionality is implemented in TYPO3 using the comments extension, which doesn’t use AJAX.

Implementing custom extensions that use AJAX technology was an interesting experience (voting extension, poll extension, Yahoo! Answer like extension). We tried to use the xajax library using some public extensions – xajax, taxajax, tdo_xajax – but we’ve encountered the same problem: if more than one plugin using AJAX was displayed on a page, only the first plugin worked as expected. Also, when making a request, a lot of unnecessary code was executed in order to create the proper answer. Finally we’ve decided to make the AJAX request using our own JavaScript implementation combined with TypoScript configuration, to avoid the execution of unnecessary code.

3. As the client requirement was to create complex relation between different data types, finding a solution for an easy, fast and user friendly relationship building was a major issue on which our best solution was to use IRRE (Inline Relational Record Editing)

4. The large amount of records added by the editors raised the question of a fast retrieval of a given record. Creating custom backend modules with advanced search filters was a successful solution.