1

I have two content types and one vocabulary:

  1. Service Categories - different categories of jobs. (VOCABULARY as the list is small and does not change)

  2. Service Tasks - tasks that relate to an individual category

  3. Services - record consisting of details related to a service performed

On the services page, I have a have a term reference field that allows the user to select the category of service. Below that I have a node reference field that I would like to have populate the related task from which to choose once the category has been selected.

Without involving programming, is there a solution to my problem? I am new to Drupal (using version 7) but am picking up the concepts quickly.

2 Answers 2

1

I would accomplish this by arranging your vocabulary like so:

  • Category 1
    • Task 1
    • Task 2
  • Category 2
    • Etc.

I would probably just name it Service Tasks, but that's my preference. Then use the hierarchical select module.

Enable the module and it's Taxonomy Select sub-module, then add a term reference to Services using the hierarchical select widget. Now you can choose tasks related to their parent categories without having to make all sorts of references.

1
  • Thank you very much Tommy! That is definitely an option that I have looked into, but I'm finding some challenges that have me looking for alternatives (multiple clicks to get the module to commit selections and difficulty working with field dependencies module). I am glad to have this option in my back pocket, but still interested to see if there are alternatives. Thanks again!
    – Joe S
    Nov 7, 2013 at 18:25
1

I recently ran into something similar to this. I had a Content Type called Subsidiary, and a related Taxonomy called SubsidiaryType. I was working on a map that plots out where all the offices of the Subsidiaries are (Many Offices to One Subsidiary), so I also had a MapPoint Content Type.

Structurally, that's the same: just as your Service had a ServiceTask through ServiceCategory, my MapPoint had a SubsidiaryType through Subsidiary.

I installed the References module, and that enables me to use a view to populate a select list in a Content Type.

Add a new View and choose the 'References' type, as well as the 'Fields' Row Setting.

Add the relationship for the Taxonomy terms, and add two fields:

  • Title (Or whatever Human Readable ID you have)
  • Term Name (but hide this)

Next, open the settings for the References List Format. You'll see a grouping option. Group by the Term name on the relationship.

Now, head back to the Content Type definition for Service, and add a field for Service Task. Choose Node Reference and then instead of using one of the presupplied relations, use a view.

Select the View we just created, and you should now have a select list that has grouped options. Here's an example of how it should look:

  • Web Development

    • HTML/CSS Markup
    • Server Administration
    • PHP/JS Programming
  • Marketing

    • Sales Call
    • Copy Writing
  • Administration

    • Process Development
    • Meetings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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