I'm trying to create a table with columns for employee data.
For example, for each employee, I have the following data I store for them:
1) Name
2) Position
3) City
4) Employment Type
Since position and city had a bunch of similar data throughout the employees, I thought it was best to just create taxonomy vocabulary for Position and City and just classify it that way (is this a good way to do this?)
So for Position, it would be populated with terms like Intern, HR, Finance, etc, and City would be like Los Angeles, Orange County, etc. and Employment Type would be Management or Staff
So I'm trying to create a view to do show the following in a table:
All Management Employees
Name Position City
Name Position City
Name Position City
Name Position City
All Staff Employees
Name Position City
Name Position City
Name Position City
Is there a way to do this using the Views interface? I tried but I couldn't get it to group by the Employee Name and show specific columns+taxonomy terms.
Thanks in advanced!
Comments
You're not far off
Okay, I'm assuming that you have some sort of node for the employee data, and you have CCK enabled.
For Position, City and Employment type you could either:
- make them into CCK text fields with default selections (this is OK if there aren't too many options)
- make them into CCK taxonomy fields (these can be linked to the general taxonomy you're using)
Once this is done, then under Views:
- go to Fields and select the relevant Content fields
- go to Basic Settings and select Row Style > Table
If you play with the Fields ordering and the Table settings, you should get what you want.
Thanks, I had figured this
Thanks, I had figured this out a couple days after and you basically had it down.
I had figured out the taxonomy part of it, it was the grouping and the field selection in the Views that was confusing.
So here was the trick:
Fields:
1. Choose:Taxonomy > All Terms > The Taxonomy Vocabulary/Term you were looking for (in my case "Position")
2. Under the checkbox for "Limit terms by vocabulary" check that box, it should bring up a section for selecting the Vocabulary you wish to limit for that field (so "Position" for my case).
3. Repeat #1 and #2 again for each column I wish to utilize in my table (in my case, City also).
Grouping by staffing types.
1) Since I wanted to group them by employee types, I repeated step #1 and #2 for the Vocabulary "Employment Type" but this time I chose to "Exclude from display" cause I actually don't want to create a column for this one.
2) Now on to the display: under the "Basic Settings" for "Style", I wanted to display tables, so I selected that and then under "Grouping field:" I selected "Taxonomy: All terms" one for the "Employment Type" field I created. This will tell the table to group by all the terms for different "Employment Types".