42 Posts
Elric
10 years ago
Topic

Hello everybody :)

As always...I'd like to have some directions from you guys since once again I'm a little bit lost in the jungle and have no stars leading in the right way.

Here's my story...

I'm using a custom list template, a tpl_basic_list.zip with some html & css to have a list of my contents, I'd like to order the list according to a specific field (a numeric value) but...though I've specified it into the search list options I don't see the results as I should.

Is there something else I have to do? I see that in the menu link option there is something about the default order but selecting CUSTOM and writing the name of the field (ranking) in the space just drives my search in no results at all.

I humbly ask a little help :), please

R.

Get a Book for SEBLOD
10 years ago
7
Level 1

Hi romyo,

You should add your specific field 'numeric value' in the "order view" of your search type.

Regards,
Mehdi.

42 Posts
Elric
10 years ago
6
Level 2

Hello Mehdi,

thank you for your interest in this problem, I'm trying to analyze every detail of this thing but maybe there is something that I still miss...

here's what I've now


I guess that it respects the conditions (it's a numeric value and it's in the ordering, obviously it's also present in the list)... but still I'm lost, I'm sorry...

572 Posts
_jrmo
10 years ago
5
Level 3

What is the result after you do this? Is it ordered like this? 1,10,11,12,13,14,15,16,17,18,19,2,20 etc.?

If you, you need to make the storage of your field an integer rather than VarChar - do this by ticking the "alter" box on your field's storage and selecting int(11).

You will then need to re-open and save all your content items.

42 Posts
Elric
10 years ago
4
Level 4

Hello _jrmo, thanks for your post

the actual order it's like 9-1-8-5-4 etc etc... totally incorrect.

I've tried your suggestion and found out another problem though, the value I pass through the form was not being saved!
Inserting the values directly into the database allows me to see that this way the list display as it should...

10 years ago
3
Level 5

Hi romyo,

I have two suggestions:

  • i think you should have this storage setting for your field "ranking": standard > article > ranking
  • can you enable the debug mode for your search type? And send us the resulted query. To enable the debug mode, you can click on button "configuration" in your search type. You will find setting debug. Please, select option "everyone" or "superadmin".

Regards,
Mehdi.

42 Posts
Elric
10 years ago
2
Level 6

Hi again Mehdi,

I premise that I'm almost ok with the manual solution of inserting the right values from the database, but for the sake of research I guess it's could be good to understand this strange behaviour.

As a first thing I've deleted the previous ranking field, in some way it was "corrupted" since whenever I was trying to change the storage method in standard or custom mode... this was never be saved.
Now I've created another field, at the moment it's a text field and the storage method it's like Mehdi suggested, the problem though remains the same

20-19-2-5, is an example of the order I'm getting now
and this is the debug query
SELECT t0.id as pid, t0.pk as pk, t0.pkb as pkb,t0.cck as cck, t0.storage_location as loc,tt.id AS type_id, tt.alias AS type_alias FROM `#__cck_core` AS t0 LEFT JOIN `#__content` AS t1 ON t1.id = t0.pk LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck WHERE t1.state = 1 AND t1.access IN (1,1,2,3) AND ( t1.publish_up = '0000-00-00 00:00:00' OR t1.publish_up <= '2013-07-30 08:36:15' ) AND ( t1.publish_down = '0000-00-00 00:00:00' OR t1.publish_down >= '2013-07-30 08:36:15' ) AND t0.cck = 'cloud_storage_provider' GROUP BY t0.pk ORDER BY t1.ordering ASC

0.011 seconds (+0.011); 13.32 MB (+13.316) - afterSearch [Cache=OFF]
0.109 seconds (+0.098); 15.67 MB (+2.356) - afterRender [Cache=OFF]

I'm very curious at the moment, I'll try once again to alter the table and change the field as a number.
cheers :)


10 years ago
1
Level 7

Hi romyo,

Can you share with us the configuration of your menu link?

In the resulted query from the search type, i see ORDER BY t1.ordering ASC. This means that your articles is oredered based the ordering data not based on your numeric field. This caused by the configuration of your menu link.

Regards,
Mehdi.

42 Posts
Elric
10 years ago
0
Level 8

Hello Mehdi!

Thank you very much, with this post you just solved the problem.

Like I was saying I have already selected the custom option in the ordering and the right field but all I had was an empty list of results, this was due to the fact that previously the field was "corrupted", like I was saying...

With the fresh one it just work as it should! thank you very much guys :) It's great to work with you.

Get a VIP membership