Share » Forums » Developer » Help me with this Idea: New Sort...

Help me with this Idea: New Sort Method for objects!

Help me with this Idea: New Sort Method for objects!

Thursday 14 April 2005 9:34:04 pm - 4 replies

Author Message

Kristian Hole

Friday 15 April 2005 1:30:13 am

I think you can solve this by adding a datatype and sorting on attributes.

Check out example 5 here:
http://ez.no/ez_publish/documentation/reference/data_fetching/content/list

However.. this will probably be slow if you use this for everything..

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Jorge estévez

Friday 15 April 2005 2:10:02 pm

Thanks for your reply...

With a dataype it could be rather slow as you mentioned, but also the client will not be able to see the sort information on the admin site just as we now can see the priority info and it will be very difficult to track priority on objects due to the need of editing them... the site I am developing is bieg and will have many articles per day...

What I would like to do is to be able to change the code and use my idea just as we can use the priority box on the admin site..

Could you point out where can I change the code so I can asign (just when the object is created) the date code (taking into consideration the 11 chars available) so instead of asigning 1,2,3,4 as priority it will asume the code generated fron the current date+time...

thanks again

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Jorge estévez

Tuesday 19 April 2005 2:53:52 pm

Can someone point out where to make changes to set up the priority explained?

thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Kristian Hole

Wednesday 20 April 2005 12:17:20 am

The priority is stored in the ezcontentobject_tree table.

mysql> describe ezcontentobject_tree;
+----------------------------+--------------+------+-----+---------+----------------+
| Field                      | Type         | Null | Key | Default | Extra          |
+----------------------------+--------------+------+-----+---------+----------------+
| contentobject_id           | int(11)      | YES  | MUL | NULL    |                |
| contentobject_is_published | int(11)      | YES  |     | NULL    |                |
| contentobject_version      | int(11)      | YES  |     | NULL    |                |
| depth                      | int(11)      |      | MUL | 0       |                |
| is_hidden                  | int(11)      |      |     | 0       |                |
| is_invisible               | int(11)      |      |     | 0       |                |
| main_node_id               | int(11)      | YES  |     | NULL    |                |
| modified_subnode           | int(11)      | YES  | MUL | 0       |                |
| node_id                    | int(11)      |      | PRI | NULL    | auto_increment |
| parent_node_id             | int(11)      |      | MUL | 0       |                |
| path_identification_string | longtext     | YES  | MUL | NULL    |                |
| path_string                | varchar(255) |      | MUL |         |                |
| priority                   | int(11)      |      |     | 0       |                |
| remote_id                  | varchar(100) |      |     |         |                |
| sort_field                 | int(11)      | YES  |     | 1       |                |
| sort_order                 | int(11)      | YES  |     | 1       |                |
+----------------------------+--------------+------+-----+---------+----------------+
16 rows in set (0.00 sec)

If you alter the table, you can get it to store longer integers.

The publishing is done in kernel/content/ezcontentoperationcollection.php
publishNode().

You can probably add some $node->setAttribute('priority'... somewhere there.

Hope this is helpful.

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu