Keyword

Category Ordering

  • Buddy Q
  • Buddy Q's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 7 months ago #79262 by Buddy Q
Replied by Buddy Q on topic Category Ordering
Thanks for the suggestion, however a component like that is over-kill since I do not need any other functionality. I think this is an opportunity to enhance the K2 component and add some sorting options that really do help make sense for flexibility in displaying content.

I am working on adding this, however, I am a noob and not so great with PHP. I have successfully added the new options via the xml files and did manage to add this:

case 'catorder':
$orderby = 'i.catid ASC';
break;
to itemlist.php which does help me. It would be great to also add something like i.catorder. 'catorder'' would need to be created which I do not know how to do.

Can you add my option to the core? Would be a nice feature.

Here is a video of my options at work: www.screentoaster.com/watch/stV0pSQ0ZIR19ZR1xdXVxeU1JQ/k2_sort_additions

Please Log in or Create an account to join the conversation.

More
14 years 7 months ago #79263 by d.k.shukla
Replied by d.k.shukla on topic Category Ordering
Hi
Sorry, I don't have good php knowledge so I will not able to help you.
Best wishes.

Buddy Q said:Thanks for the suggestion, however a component like that is over-kill since I do not need any other functionality. I think this is an opportunity to enhance the K2 component and add some sorting options that really do help make sense for flexibility in displaying content.
I am working on adding this, however, I am a noob and not so great with PHP. I have successfully added the new options via the xml files and did manage to add this:

case 'catorder':
$orderby = 'i.catid ASC';
break;
to itemlist.php which does help me. It would be great to also add something like i.catorder. 'catorder'' would need to be created which I do not know how to do.

Can you add my option to the core? Would be a nice feature.

Here is a video of my options at work: www.screentoaster.com/watch/stV0pSQ0ZIR19ZR1xdXVxeU1JQ/k2_so...

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #79264 by Jeff Lin
Replied by Jeff Lin on topic Category Ordering
Hi,

Thanks for the tips on editing com_k2/models/itemlist.php.

available fields (i.e. catid) can be found on phpMyadmin jos_k2_items table fields.
basically add the following

case '':
$orderby = 'i.';
break;

then in phpMyadmin, jos_k2_categories table > browsing
choose category > edit
field: params > change "catOrdering=" in value column
save

and it should work





Buddy Q said:Thanks for the suggestion, however a component like that is over-kill since I do not need any other functionality. I think this is an opportunity to enhance the K2 component and add some sorting options that really do help make sense for flexibility in displaying content.
I am working on adding this, however, I am a noob and not so great with PHP. I have successfully added the new options via the xml files and did manage to add this:

case 'catorder':
$orderby = 'i.catid ASC';
break;
to itemlist.php which does help me. It would be great to also add something like i.catorder. 'catorder'' would need to be created which I do not know how to do.

Can you add my option to the core? Would be a nice feature.

Here is a video of my options at work: www.screentoaster.com/watch/stV0pSQ0ZIR19ZR1xdXVxeU1JQ/k2_so...

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #79265 by russjman
Replied by russjman on topic Category Ordering
I added this ordering option to the category.xml file and the case to itemlist.php.  Shouldn't this be picked up by the Joomla admin automatically with these changes; i dont see the new ordering option i added in the dropdown list in the category admin.  Its not very user friendly to have to modify the db via phpmyadmin just to change the display order.

 

To reiterate Buddy Q, this is definitely a display option that should be included in the core.

Jeff Lin said:

Hi,
Thanks for the tips on editing com_k2/models/itemlist.php.

available fields (i.e. catid) can be found on phpMyadmin jos_k2_items table fields.
basically add the following

case '':
$orderby = 'i.';
break;

then in phpMyadmin, jos_k2_categories table > browsing
choose category > edit
field: params > change "catOrdering=" in value column
save

and it should work





Buddy Q said:
Thanks for the suggestion, however a component like that is over-kill since I do not need any other functionality. I think this is an opportunity to enhance the K2 component and add some sorting options that really do help make sense for flexibility in displaying content. I am working on adding this, however, I am a noob and not so great with PHP. I have successfully added the new options via the xml files and did manage to add this:

case 'catorder':
$orderby = 'i.catid ASC';
break;
to itemlist.php which does help me. It would be great to also add something like i.catorder. 'catorder'' would need to be created which I do not know how to do.

Can you add my option to the core? Would be a nice feature.

Here is a video of my options at work: www.screentoaster.com/watch/stV0pSQ0ZIR19ZR1xdXVxeU1JQ/k2_so...

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #79266 by stuartmarsden
Replied by stuartmarsden on topic Category Ordering
A very useful thread for me as I could not get the ordering I wanted when showing a category.  I have a small number of items and wanted them in category order first and then within that in the item order.  This is easy in standard joomla but I could not figure it out in K2.

 

I used the info here to change my itemlist.php to fit my needs and added this:

 

case 'catorder':

  $orderby = 'c.ordering, i.ordering';

  break;

 





I also tried to change the xml but it did not show up in the settings for the category meaning I will have to alter the database after any time I make a change.

 

Any solutions to this?  I would like to see this added as a standard method of ordering in future versions.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum