Keyword

[SOLVED] Order tags in Add Article Form

  • webloesung
  • webloesung's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 10 months ago #121749 by webloesung
[SOLVED] Order tags in Add Article Form was created by webloesung
Hello,
on our installation the tags are showed for selection (in Add article form in frontend,) ordered by TAG ID. This is not user friendly :(.
Is there any possibility how to show the tags ordered by NAME?
Can it be done somehow in itemform.php?
Thank you very much for feedback!

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 10 months ago #121750 by Yiota
Replied by Yiota on topic Re: Order tags in Add Article Form
I'm afraid that this cannot be done without tampering with the K2 core files.

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

  • webloesung
  • webloesung's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 10 months ago #121751 by webloesung
Replied by webloesung on topic Re: Order tags in Add Article Form
can i add somehow the "ORDER by NAME" for listing of availible tags within itemform.php (which is already modified and is placed in template html folder )?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #121752 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Order tags in Add Article Form
I don't think editing core files is the best approach here. You can add a simple JS script like this -> jsfiddle.net/stodolaj/De8Ku/ which will continue to work after you have updated K2 (no need for repatching).

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • webloesung
  • webloesung's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 9 months ago #121753 by webloesung
Replied by webloesung on topic Re: Order tags in Add Article Form
thank you! it works good with UL, but with SELECT element there is an issue :(:
the sorting is showing properly within the select list, but after saving some other tags are shown. Looks like the VALUE of SELECT OPTION is somehow not taken into concideration by sorting the select list.):

1. before the sorting the select list:
<option value="3">Vegan</option>

2. after soring of the select list:
<option value="3">APPARTMENTS</option>

systems saves value "3" what is actually "Vegan" and not selected after sorting "Appartments" ...
is it possible to sort with ids of values?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #121754 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Order tags in Add Article Form
Have you checked this out: stackoverflow.com/questions/12073270/sorting-options-elements-alphabetically-using-jquery ?

Let me know if that did the trick.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • webloesung
  • webloesung's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 9 months ago #121755 by webloesung
Replied by webloesung on topic Re: Order tags in Add Article Form
going to be interresting :)

did the following:
Log in  or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #121756 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Order tags in Add Article Form
I can see you are a purist. No jQuery at all.

Can you send me the resulted HTML of that script? is the value attribute omitted?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • webloesung
  • webloesung's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 9 months ago #121757 by webloesung
Replied by webloesung on topic Re: Order tags in Add Article Form
:lol: i would love to use jQuery - the question is how?
was trying with github.com/vafour/select2-sortable -> haven't got it running at all.

as i understood: i have to:
1. add jquery.multisortable to be used (not sure where to add it to be correct - to itemform.php or to be loaded on index.php?
2. create a button for sorting (done)
3. declare within the button event the event calling respective jquery function ($('ul').multisortable();?)

so far to the theory .. :)
now i am woundering how to imlement it...

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #121758 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Order tags in Add Article Form
Actually,

You have to use the select 2 script and then use that script. It won't work otherwise.
ivaynberg.github.io/select2/

I am not sure if extra coding is needed.

You can load it only on itemform if it is not needed elsewhere.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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