I, and, many, others, had the issue that it’s not possible to apply a default sorting for child objects of the type Tx_Extbase_Persistence_ObjectStorage with extbase. For exmpale, I happen to have a “course” object which stores “event” objects. The default getter would just
return $this->events;
without no possibility to define in what ordering the objects are returned.
Setting the default ordering in the event repository has no effects whatsoever. But the problem is actually pretty easy to solve. Just create an instance of the child object repository in the parent model and then you can use the default findBy methods. Lets say your parent object is called “Parent” then you’d use findByParent($this->getUid());
In the child repository apply your sorting and do whatever you like:
I stubbled across this today on a clients page; I used f:format.html to pare some rte content. Somehow there where empty <p> tags before and after the content. At first I thought the RTE was at fault. But then I realized the problem was in my template;
<f:format.html>
{rtecontent}
</f:format.html>
The linebraeaks before and after the fluid variable ‘{rtecontent}’ are responsible for the additional <p>’s. Conclusion: Don’t use linebreaks when you use <f:format.html>, instead use this:
I just figured out how to configure a default language for multiple domains in Typo3 with TypoScript. Its pretty easy actually – no fuss with realUrl. It checks for the HTTP_HOST when no L Parameter is set:
# Default language, sys_language.uid = 0
config {
sys_language_uid = 0
language = en
htmlTag_langKey = en
locale_all = en_US.UTF-8
}
[globalVar= GP:L=1] || [globalString= IENV:HTTP_HOST=*.de, IENV:HTTP_HOST=*.ch, IENV:HTTP_HOST=*.at] && [globalVar = GP:L=]
config {
sys_language_uid = 1
language = de
htmlTag_langKey = de
locale_all = de_CH.UTF-8
language_alt = en
}
[global]
This is for you, if you are familiar with TemplaVoila for Typo3 and you are using FCEs to create multicolumn container elements. Problem with these Elements is that when the author creates the column element, he is faced with the Edit-Maks usualy needed for normal content elements. But since the column element has no data yet to edit just some container for elements, this view is not required. A simple line in your FCE XML skips the edit mode. Put this in the meta section of your DataStructure: <noEditOnCreation>1</noEditOnCreation>
I recently came across an old website of ours that I wanted to migrate to a new server. When I finished migration, I found the special characters typical to european languages broken. It took me a while to find the problem. The data was wrong in the Database but on the old system it was displayed correctly, the new didn’t. I finally figured out that my database suffered from double encoded UTF-8 characters.
It seams, that double-encoded UTF-8 texts are a fairly common problem when dealing with MySQL. This may be due to the fact that the default character set of the connection to the server is Latin-1, but that is not relevant once the data is already corrupt.
Here is how to fix it – export the database using latin1 charset an re-import with utf-8: