sorting tt_content

View: New views
3 Messages — Rating Filter:   Alert me  

sorting tt_content

by Christian Kartnig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I want to move lots of content of a site from the right column
(colPos=2) to the bottom of the normal column (colPos=0) via a database
query or a script.

Now I'm not sure how the sorting is done in the sorting column of
tt_content. I want the new content to be always at the bottom.

Can anyone give me a hint, please?

regards,
Christian
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: sorting tt_content

by JoH asenau :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I want to move lots of content of a site from the right column
> (colPos=2) to the bottom of the normal column (colPos=0) via a
> database query or a script.
>
> Now I'm not sure how the sorting is done in the sorting column of
> tt_content. I want the new content to be always at the bottom.
>
> Can anyone give me a hint, please?

tt_content contains a field named sorting.
Default behaviour is: The higher the value the lower the position of this
element on the page.

So you have to fetch the highest sorting value available of the normal
column on that particular page.
Then you have to add this value to each sorting value of the items you are
going to move to make sure they
a) will appear below the "old normal" elements
b) will keep the sorting they already got in the right column.

HTH

Joey

--
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com


_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: sorting tt_content

by Jigal van Hemert-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christian Kartnig wrote:
> I want to move lots of content of a site from the right column
> (colPos=2) to the bottom of the normal column (colPos=0) via a database
> query or a script.
>
> Now I'm not sure how the sorting is done in the sorting column of
> tt_content. I want the new content to be always at the bottom.

A deleted item gets sorting value 1000000000
If a record is added to the bottom of a list it will get the highest
sorting value (of a not deleted record) + 256.
If a record is added to the top of a list it will get the lowest sorting
value devided by 2.
If...

If the algorithm runs into problems it calls a resorting function.

You can find the algorithm and functions in
t3lib/class.t3lib_tcemain.php, t3lib_TCEmain::getSortNumber() and
t3lib_TCEmain::resorting().

Regards, Jigal.
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev