0

I am trying to sort the list of content according to the weight order given to taxonomy term.

Terminology used:

content type : contact-person-details

taxonomy : company vocabulary which has list of company names like company A, company B, ...

session company : every user has a company which is stored in session, users have similar company names too.

how it works now: Imagine I am from "company A" stored in my session. Based on my company, content in a view is getting shown (company A is the taxonomy term used for filtering). Views are used to filter the content type contact-person-details. Varies from company to company which was tagged to content, based on user session company.

What I am trying to achieve? Image below helps in understanding the visual concept. Imagine list (Test one, Test sort, ...) shown are the company vocabulary lists, just like (company A, company B, ...) I want an additional field or textbox just to the side of each term showing to add weight. This weight should be available in the view so that I'm able to making sorting based on the weight allocated for each content.

enter image description here

I would like to know is there a existing possibility to weight the taxonomy list in field.

If it is still complex to understand I will try to edit my explanation.

  • Can you tag this with the Drupal version, please? – Alfred Armstrong Jul 30 '18 at 13:47
  • opps, tagged now. – Arun G Jul 30 '18 at 13:51
0

The Taxonomy Term Reference Sortable Widget module appears to meet your requirement. Once installed, the module will provide a widget that can be selected for a taxonomy term field via its widget type panel. (Admin -> Structure -> Content Types -> My Content Type -> Manage Fields -> My Field -> Widget Type).

If you have a lot of different terms available this may not be a good choice because it displays a full master list of terms from which you select and order those you need. It does not have an option for using autocomplete to build the set.

  • Thanks for the help, this seems to be helpful but not meeting my requirement. As I am using a field as entity reference instead of term reference. This works only for term reference. Yet I will have an understanding how to make a custom module to work on my scenario. – Arun G Jul 30 '18 at 15:12
  • Yes, although the maintainer of the module refused to make it work with entity references it's probably not that big a job to adapt it if you are able to write custom module code. – Alfred Armstrong Jul 30 '18 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.