Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By ChocolateTeapot on
In Drupal 6 you could assign a taxonomy vocabulary to content types.
I can't see this option in Drupal 7 so I'm not sure how to assign a taxonomy term to content. I have the ability to assign tags to an article, but not any of the vocabulary/terms that I've created.
Any help appreciated, thanks.
Comments
Fields
There's a lot about Drupal 7 that is designed to be more usable by beginners, but may be confusing if you come from D6 with expectations of where to find your tools. This is one of those situations.
Fields (CCK) have been moved into core, and taxonomy is treated as just another field -- not some separate and special concept.
If you edit your content type (admin->structure->content types) existing vocabularies will be available in the "add existing field" widget. To create a new vocabulary and associate it with a content type, just "add new field" of type "term reference."
You also can go admin->structure->taxonomy and add a vocabulary there, but (as you discovered) that doesn't glue it to the content type.
That's really helpful. Thanks
That's really helpful.
Thanks for your time.
I had the same problem, and now it's gone :)
I've had the same problem and now it's gone :) Thanks!
Thanks for the explanation of using Taxonomy
Hi yelvington,
Thank you so much for this post. Coming from Drupal 6, I couldn't find how to create taxonomy free tagging boxes, and just didn't understand what to do with the taxonomy. I set up a Drupal 7 test site to experiment with, and also searched and searched trying to figure out how to use Taxonomy in Drupal 7. While I don't fully yet understand it, your post has greatly helped me to begin to have a better understanding.
Your statement here...
.... helped me to get to thinking in a different way. Taxonomy is no longer a separate component, but is now a field. That took some real re-thinking on my part. Your short explanation was very helpful to me. Then, after you explained that it was a different concept, the other part of your post explains how to find and use the Taxonomy fields.
I had looked through the Drupal documentation on Taxonomy and non of this was explained. Your explanation here (perhaps go into just a bit more detail) would be very helpful if it was in the Documentation section. After much frustration, your message was very helpful to me.
After reading your message I have been able to create a taxonomy field and attach it to a node type in my Drupal 7 test site.
I hope you don't mind, but I found your message so helpful that I copied it into the Documentation here: http://drupal.org/node/774884 Feel free to go there and edit and improve it if you wish. I don't yet Drupal 7 taxonomy enough to write something up myself. But I thought your explanation was important enough to be in the documentation.
Thank you, Thank you, Thank you,
Best Wishes,
Stephen
vocabulary fields
excellent post..thanks a lot yelvington
but i am still confused
* i created some fields for a vocabulary.But i found no change or effect that it makes.
* i am curious to know what is the significance of the created fields of a vocabulary.that is why or for what purpose do we create fields for a vocabulary..
may be a silly question :)
I for one
use it for my "event" content type for selecting the type of event (educational, committee, featured speaker, etc). It's just another way to categorize content for creating custom views to display it.
drupal 7
thanks cfox612..
I have another question. can
I have another question. can I use taxonomy fields in views?
Creating new Vocabs via "Add new field"
While most of this comment is great, it seems to me that the quoted section above is not quite right. Unless I'm missing something, I always have to create a new Vocabulary via Admin->Structure->Taxonomy before I can reference it in the "Manage Fields" dialog. Right?
That's why it says "EXISTING'
That's why it says "EXISTING vocabularies will be available" (emphasis mine).
-Kelly Bell
twitter: @kelly, @gothamdrupal
http://gothamcitydrupal.com
Hi there,
Hi there,
I created a new vocabulary with terms in Taxonomy in Drupal 7 before I made the content type for it. However, the new vocabulary is not showing up in the 'add existing field' pull down menu. Any ideas?
Never mind, I figured it out.
Never mind, I figured it out. You have to create a new field in the content type, under 'Select a Field Type', choose 'Term Reference', then when you hit save, you'll be prompted to add the vocabulary.
Hello,
Hello,
first I'd posted here https://www.drupal.org/node/1355964#comment-9991565 because the sorting by a taxonomy term wasn't working, but after some more research it looks more and more, as if the not working sorting is just a follow-up issue. The real issue seems to be, that the view seems not to recognize the relationship between the content and the taxonomy terms.
I didn't manage to find a solution after a 2-days-research, so posting here, because this issue fits in here rather than in the other thread.
That's what it roughly is about: a website for a software. The software has got different areas / functionalities (contact management, invoice management etc.) One of the pages is a screenshot gallery, which shows screnshots for each area as a colorbox / field-slideshow.
That's what I have done so far (can't upload any screenshots for some reason, so posting the links to an external image hoster (directupload.net):
While doing some troubleshooting I've found out, that once I turn on the option "Require this relationship" for the added relation "Content: Taxonomy terms on node", the view doesn't output anything anymore. Also when I had added the field "(Program areas) Taxonomy term: Weight" to the output field list (after turning off the require option again), the weight of all displayed items was 0. So the view doesn't recognize the relationship for some reason, although the structure within the database looks alright as well (found some hints for what to check).
While writing this, I was using my test environment and had one last idea just in this moment, when trying to set up a new view. When I saw the default filter criteria "Content: Published (Yes)", I remembered, that my contents were not published. I've published them as a test and.... it worked! The displayed weight of taxonomy terms is correct, the sorting seems to work, the option "Require this relationship" does still output all the contents...
So a relationship bewteen the contents and taxonomy terms is only recognized within a view, when the contents are published, which looks like a bug to me though. I didn't want my contents to be available as separate pages, but only as the source for the view(s). Since there is the filter criteria "Content: Published (Yes/No)" for views, they seem to be designed to support the output of the not published contents as well, so I think the relations to taxonomy terms should work for such not published contents as well.