Keyword

Item Tags organized Alphabetically

  • Clifford Sonnentag
  • Clifford Sonnentag's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 5 months ago #82026 by Clifford Sonnentag
Item Tags organized Alphabetically was created by Clifford Sonnentag
UPDATE: The hack to do this is written below. Still a feature would be nice.It would be great to have the selectable tags organized alphabetically in a new item administration.Also to have them fixed so you don't have to save the article/Item to add new tags.Doesn't seem to hard to make the first happen.  I'd be willing to do it.  I've never helped on a dev though.Please tell me if this is incorrect or there is a better way, but I have done this:in administrator/components/com_k2/models/item.php line 757near:        if (!is_null($itemID))            $query .= " WHERE tags.id NOT IN (SELECT tagID FROM #__k2_tags_xref WHERE itemID={$itemID})";        $db->setQuery($query);I canged it to:        if (!is_null($itemID))            $query .= " WHERE tags.id NOT IN (SELECT tagID FROM #__k2_tags_xref WHERE itemID={$itemID}) ORDER BY tags.name";        $db->setQuery($query);added: ORDER BY tags.nameThey sort in alphabetical order now.  Is there an option for this and someone will make me look silly now?  :)

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

More
13 years 9 months ago #82027 by Renea
Replied by Renea on topic Item Tags organized Alphabetically
Code has changed in 2.4.1
Any thoughts on how to make this work with the new tagging code (around line 570?)

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

  • Clifford Sonnentag
  • Clifford Sonnentag's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 9 months ago #82028 by Clifford Sonnentag
Replied by Clifford Sonnentag on topic Item Tags organized Alphabetically
Well, I haven't looked at K2 code in a while, i'll check it out, but can't get to it right away. If anyone else has a comment on this??

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

  • Rafael Franco Moreno
  • Rafael Franco Moreno's Avatar
  • Offline
  • New Member
More
13 years 9 months ago #82029 by Rafael Franco Moreno
Replied by Rafael Franco Moreno on topic Item Tags organized Alphabetically
cliffclof

if you order but after the tag 23 and does not order, anyone know why?

sorry for my English

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

More
13 years 8 months ago #82030 by Renea
Replied by Renea on topic Item Tags organized Alphabetically
HUGE Thanks to cliffclof for the code and Patrick for telling us where to add it in 2.4.1! Thank you thank you thank you. Works perfectly as long as you don't have duplicate tags (silly me)

Patrick said:

thanks cliffclof! works in 2.4.1 as well.

in administrator/components/com_k2/models/item.php my line 787 now reads

$query .= " WHERE tags.id NOT IN (SELECT tagID FROM #__k2_tags_xref WHERE itemID=".(int)$itemID.")ORDER BY tags.name";

 

exactly what i needed!

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

  • Rafael Franco Moreno
  • Rafael Franco Moreno's Avatar
  • Offline
  • New Member
More
13 years 7 months ago #82031 by Rafael Franco Moreno
Replied by Rafael Franco Moreno on topic Item Tags organized Alphabetically
Patrick got the same query you have and on the same line (787) but does not work! also put the query to cliffclof and does not work, I have the k2 2.4.1 too, when I capture the tags are well organized to the tag 24 after the tag 25 puts me above all in order, the order starts again, someone knows why this happens? or do I need? greetings and thanks. sorry if I write bad English

Patrick said:
thanks cliffclof! works in 2.4.1 as well.

in administrator/components/com_k2/models/item.php my line 787 now reads

$query .= " WHERE tags.id NOT IN (SELECT tagID FROM #__k2_tags_xref WHERE itemID=".(int)$itemID.")ORDER BY tags.name";

 

exactly what i needed!

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

  • Rafael Franco Moreno
  • Rafael Franco Moreno's Avatar
  • Offline
  • New Member
More
13 years 7 months ago #82032 by Rafael Franco Moreno
Replied by Rafael Franco Moreno on topic Item Tags organized Alphabetically
it work already but only to edit items, for create items not yet.

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

More
13 years 6 months ago #82033 by McGreg
Replied by McGreg on topic Item Tags organized Alphabetically
But it not show alphabetical tag in fronted adding items when you use Selection-based tagging, any reason for it?

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


Powered by Kunena Forum