I have been struggling with USER and USER_INT for quite a while now. At first I thought my problem was related to TemplaVoila, but in the end I reverted to a clean installation of TYPO3 version 4.5.40, and the problem persists.
To test it I have made a new installation of version 4.5.40.
My template setup looks like this:
includeLibs.beechgroveTest = fileadmin/php/test.php
page = PAGE
page {
10 = USER
10 {
userFunc = getBeechgroveTest
}
}
In fileadmin/php/test.php I have this code:
<?php
function getBeechgroveTest($content, $conf) {
return "func";
}
echo "Load: ";
?>
In the page module I have added a shortcut to a standard page. the standard page has no content elements.
Apart from that no changes have been made since the install.
When I load the website I see the text 'Load: '.
If I reload the website then the text disappears.
If I change USER to USER_INT the text remains, when I reload the website.
This tells me that USER and USER_INT is being recognized, but userFunc seems to be ignored.
I made the same test with a clean install of version 6.2.13.
But here I get the text 'Load: func'.
And when I reload it changes to 'func'.
If I use USER_INT the text 'Load: func' remains, when I reload.
In other words with version 6.2 it works as expected, but not in version 4.5. All the information I have been able to find, indicates that it should work in 4.5, so what am I missing?
Is there some configuration that needs to be done in order to enable userFunc in 4.5?
That means you have to put your function inside a class, make sure that this class is autoload-able (
naming convention
) and use the formclass->method
to register your methods.Please keep in mind that the possible class names are restricted.