In the backend I filled out the date field for several content elements in this format 24-12-2011.
In the database of typo3 the date value looks like this: 1293836400
I want to render some content using the date as a condition..
10 < styles.content.getLeft
10 {
select {
orderby = date
pidInList.field = uid
}
}
Okay okay.. this worked fine. I see the contentelements all is cool.
But then I was curious if it still works when I change the position of the pages which contain those contentelements.
BEFORE Pagetree:
page200 with content element with date 1-1-2011
page201 with content element with date 1-2-2011
page202 with content element with date 1-3-2011
page203 with content element with date 1-4-2011
Frontend Output:
content element with date 1-1-2011, content element with date 1-2-2011, content element with date 1-3-2011, content element with date 1-4-2011
AFTER (changend positon of pages in the backend) Pagetree:
page202 with content element with date 1-3-2011
page201 with content element with date 1-2-2011
page200 with content element with date 1-1-2011
page203 with content element with date 1-4-2011
Frontend Output:
content element with date 1-3-2011, content element with date 1-2-2011, content element with date 1-1-2011, content element with date 1-4-2011 (IT CHANGED!)
So it changend the position in my frontend output. BUT that is irrelevant because I declared: “orderby = date(!)” and not “orderby = sorting”. So why does is sort it by order? I dont get it..
The fields in
orderByare not escaped. Asdateis a function in MySQL, you have to escape it yourself: