One of my client requirement states they need to sort some field based on taxonomy id. I am very much fine with sorting it based on Id or name in asc or desc order. But client states that they need to have taxonomy name drop down menu. Based on selection of taxonomy name it should get sorted(Seems quite illogical) but still is there some way to achieve same.

CommentFileSizeAuthor
#2 Capture.PNG2.47 KBpramodga

Comments

dcam’s picture

Assigned: pramodga » Unassigned
Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

I'm sorry, but I don't understand what you're asking for. You need to sort the contents of one field based on a taxonomy term selected in another field? Is this on a node edit form? Am I totally misunderstanding?

pramodga’s picture

StatusFileSize
new2.47 KB

Hi dcam,
Thanks for your response. Actually requirements is providing with dropdown list "category". If we select "Category 1" from dropdown.
The Category 1 contents should get sorted.

sort

dcam’s picture

Status: Postponed (maintainer needs more info) » Active

Oh, do you mean filtered? As in:

You have a list of 100 nodes.
15 of those nodes are tagged with Category 1.
You select Category 1 from the drop-down.
Then only those 15 nodes are displayed in the list.

sidharthap’s picture

Is it something like :

1 - Vocabulary - (category1 in your case)
2 - Vocabulary contains 5 terms and the requirement is to sort these terms ?

pramodga’s picture

Exactly dcam... So the nodes will sorted based on taxonomy id, right???

pramodga’s picture

@sidharthap : Actually category 1 is a term under Vocab- Category

dcam’s picture

Issue tags: -exposed sort

I'm sorry if there has been miscommunication between us, but saying that you want to sort the list when a taxonomy term is selected makes no sense to me. What I am talking about is referred to as "filtering," not "sorting." "Sorting" implies that the entire list is re-ordered based on some value. "Filtering" means that certain list items are removed from the list based on some value.

From your reply in #5 it sounds like my description in #3 is what you want, to filter the list based on the taxonomy term. This is very easy to achieve using the Views module. and there are many guides available on the Internet that will show you how, but I will list the basic steps here:

  1. Download and install the Views module.
  2. Create a new View that displays nodes of the content type you need. When creating the view, select the page view option.
  3. After doing the initial view setup, edit it so that you can customize the view.
  4. In the filters section, add a new filter based on the taxonomy vocabulary you want. Check the box to expose this filter. This will make the filter appear in a form element above the list of nodes.
  5. Save the filter and then save the view.
  6. If you visit the new View's page (or check out the live preview at the bottom of the admin editing page) then you should see the list of nodes with the exposed filter above it. Select the value you want from the form and the list of nodes should be filtered.

If you want to reload the list with AJAX, rather than having to reload the whole page there is an option for that. In the View's admin edit page, look for it in the Advanced Options.

I hope this helps you and that I haven't misunderstood what you want to do.

pramodga’s picture

Exactly dcam....Will try out this. Thanks for valuable feedback

dcam’s picture

Let us know how it goes. If it works for you, then please mark this issue as being fixed. Good luck!

pramodga’s picture

Status: Active » Closed (fixed)
pramodga’s picture

Working fine dcam. :)