attach multiple images to a taxonomy term - drupal

I have installed "Taxonomy Image" module.
but i can not find a way to attach multiple images to one taxonomy term
my drupal version is 6

As a side note to what Henrik answered, an alternate way to implement what you want without having to code a single line could be:
Create "image nodes" for each term of your taxonomy.
Associate each image node to the right term of the taxonomy (here's where it get interesting: you can create more than one image node per term and can also use the same image node for different terms).
Create a wiew that takes as arguments the taxonomy term/terms and show all the image nodes tagged with that term.
If you already know the views module you probably realise how easy it is. If you are new to Drupal and do not know it yet, then I recommend you take a close look at it together with the CCK one: they are big and require some time to be "grokked" (neither so much, though!) but every second you spend studying them is worth it!
Using views also gives you a lot of flexibility as you can theme easily theme your output in tables, lists, grids, add or remove associated fields, and even put extra filters or expose them to the user in separate blocks...
HTH!

As far as I can see, the module does not provide the option to attach multiple images to one term. From the features list on the project page:
Allows one-to-one term-to-image relationships.
Allows many-to-one term-to-image relationships.
So one term can have exactly on image, or multiple terms can have the same image (for 'inheritance' of a parent term image), but no 'multiple images per term' option.
I have not delved into the modules code to look if there is an easy way to change this, though. So far, there seems to be no request for this feature either.

The easiest way is to first install the following modules:
Views Bulk Operations
Administration Views
After enabling both modules. Go to Admin >> Structure >> Views and edit the Administration: Files view. Add the desired taxonomy field.
Go back to the Administration >> Content >> File and there you`ll see now operations, select change value and the desired images you wish to have the same taxonomy term. Click Execute >> Your taxonomy field. Select the term or terms and click next. That is it.

Related

Views and Categories...?

it's about this page: http://veagues.com/
Hey guys,
I've made a block-view with drupal that let's me sort my videos by a certain category, in this case "funny","epic","plays", "contest"...
The problem is: When you sort it by the certain category and click on a video and continue to click the "next" button, you will go threw all videos, instead of only the videos of the category...
My Question is: How can I put a filter on the nodes when i apply another category on the bottom block?
Thanks already!
If you're using Views, you should be able to filter the main block by the same taxonomy term.
Try adding a Contextual Filter to that block too. If there's a taxonomy term ID in the URL the block gets filtered by that Term ID and if there's no result, the block shows all the videos.
EDIT -----------------------------------------------------------------------------------------
You may need to try & understand what goes on when you make a selection in Drupal.
1/ The taxonomy term page will list all the content affixed with a specific term. The term tid can be seen in the URL, unless an alias have been created. A block can retrieve that term id, whether there is an alias or not.
2/ The node page will give you access to a specific node, but any block on that page should be able to access the term id of that specific node.
If you know where you are, it becomes easier to retrieve the info you're looking for. On the other hand, you may have to reconfigure a specific page in order to add the necessary extra block...
That can be done with templates but you could also have a look at Panels.
The Panels UI makes it easier to configure the page you're looking for without having to mess with code or templates, or both.
There's a lot of free video tutorials out there, search for Views & Panels.
If you want to have a look at preprocess functions, you will definitely need to download the Devel module...
...but have a look at these sites first:
http://codekarate.com/
http://drupalize.me/
http://buildamodule.com

Creating list of similar nodes in Drupal 7/Views 3

Copy from drupal.stackexchange.com hoping to get more answers here:
I face a rather common problem of displaying a list of nodes similar to current one. Similar node is defined as one having at least one taxonomy term that current node has. There are few solutions available as modules, however the modules I've found (specifically Similar By Terms) are in beta stage (as in "not working properly") for Drupal 7.
I've also found a couple of solutions based on Views and contextual filters (such as http://scito.ch/content/show-related-nodes-block-based-taxonomy-terms-views-3-and-drupal-7) or relations. I quite like this way as it saves me installing extra modules and with Views being actively developed and supported I'd prefer to use them rather than any custom solution. The problem I can't get around is how to sort "similar nodes" by the number of terms they share. For example, if I have "IPhone 4S" Node with Terms "Gadget", "Apple", and "Phone", I want similar nodes in the following order:
IPhone 3 (Apple, Gadget, Phone)
IPad (Apple, Gadget, Tablet)
Mac (Apple, Computer)
Bramley (Apple, Fruit, Tree)
How can I sort nodes in this view by the number of terms they share?
This question is about building a view, please do not suggest module or custom php-based solutions. Thank you.
Create a block view
Add Contextual filter -> Content: Nid -> Provide default value -> Content ID from URL
Add Relationship -> Content: Taxonomy terms on node -> specify the appropriate vocabulary
Add Relationship -> Taxonomy term: Content using vocabulary as specified above -> Check off Require this relationship
Turn on Views aggregation (NOTE: the arrow in the screenshot below is pointing to the wrong spot and should be pointing to 2 rows below where it is)
Assuming you are listing title only, edit the title field to use the Relationship you set up in #4 above.
Add new sort criteria of Content: Nid. In aggregation settings, select Count. Use relationship from #4 and sort descending
Add Contextual filter -> Content: Nid -> Use relationship from #4 -> Provide default value - Content ID from URL -> Scroll down and expand "More" then check "Exclude" to remove current node from the view
** See comment by #garret-albright below for testing this in the Views UI preview. **
guess what - there are modules for that too :D
i can recommend similar by terms giving you that view without configuration hassle.
When you are configuring complex views like this one, there are some configuration tips that may help you to understand what is really going on each step:
In Structure >> Views >> Settings >> Basic:
Check 'Show advanced help warning' (important: requires Advanced Help module installed)
Check 'Automatically update preview on changes'
Check 'Show information and statistics about the view during live preview'
Check 'Show the SQL query'
and finally, Save configuration
Now you can preview the results from each configuration step, the SQL query associated and the fields and tables involved, so you will find easier to understand how filters and aggregations work.
Hope it helps.
This is an alternative solution, related to this question. However it might not apply to every case, but if you can use it it's simpler (and safer than aggregation in my opinion).
I am going to use panels. Once you create a panel to show your entity (node or anything else) you can add multiple views and show them beside the content. one of these views is going to be our related content.
Thus panels is the only limitation. Maybe it's possible to use mini-panels and represent it as a block, I haven't tried myself.
Prerequisites
Views (d'oh!)
Panels
Views Content Pane: no need to download, It is in ctools module downloaded with views.
Page manager: Same as Views Content Pane (Optional / Highly Recommended).
The view
Create your view as you normally would, but do not create it as a block or page. Uncheck both.
In views configuration page create a relation to taxonomy term on the entity.
Create a contextual filter to filter: Taxonomy term: Term ID.
Create another contextual filter: Entity ID or Content: Nid if it's a node.
While creating this one, at the bottom there is a collapsed fieldset which has the option: Exclude. Check it as marked.
Now by clicking Add create a new display of type Content pane.
In the display configuration area (named: Pane settings) open Argument input. You should have 2 options:
Content: Nid source : Set it's source as From context. Set it's Required context as Content ID (if you are not using node it can be ID.
Taxonomy term: Term ID source : Set it's source as From context. Set it's Required context as Term ID.
Congrats! You are done creating your view. It's time for a panel (I wont explain much about creating a panel as it is beyond the scope of this Q/A).
The Panel
Create a panel (or enable the node/%node default panel and add a variant).
In context tab, Create a relation to taxonomy term on the entity.
Click add content in one of panes.
If you didn't change the view's category, it's in views pane add it. It will ask for an Entity ID and Term ID both are available now in your panels context, set them.
Now when the panel is displayed, All the content with with the same term excluding the content on this page are displayed.
Views Configuration
Contextual filter
Argument input
Important P.S:
This method is tried and it works flawlessly, but at the time of writing this article ctools had a bug. There is a patch for it: https://www.drupal.org/node/2195211
I am not sure if I fully got the gist to your question but I think node queue is the answer. Check out http://drupal.org/project/nodequeue
The module is well developed. I have used it for a client and you can use their smartqueue api too make make your list.
Hope I was helpful.

Drupal 7: filter by two or more taxonomy terms

Is there any way to filter content by two or more taxonomy term.
For example: I've got two vocabularies: car brand(Toyota, BMW, Ford) and car type(crossover, sedan, bantam car). How i can create filters like: Toyota&sedan, Ford&crossover etc?
The easiest way to accomplish this would be to use the Views modules. This module allows you to create complex custom displays of any of your content.
Basically you will create a View. Each View can have multiple Displays. Displays can be either pages or blocks. In your case you will want to create a page. Once you've created the page, you can add what are called Filters. Filters allow you to pass in variables to that page, which will limit the returned results.
I apologize for the misleading earlier response. I think it may now be more clear the path I was taking you down. Once you feel comfortable with Views, have a look at my previous response below.
OLD RESPONSE: You should be able to create two filters, one for each vocabulary. Then select one or more terms in each filter. Or have them exposed and select this way. There are many options here, you should play around a bit more in Views.
Take a look at the "Content: Has taxonomy term" filter specifically.

Better content administration, sort by node's CCK fields?

I was asking myself if there's a better way of sorting content in Drupal.
Right now, when I go to admin>content all the nodes are mixed up. I installed the module "Content administration" (http://drupal.org/project/nodeadmin) and now you can not only filter but also sort them by title, type, author... but that's all.
Is there any good module to improve the content administration a part from the one I mentioned?
For instance, it would be great if I could filter the nodes by their CCk field values.
An easy way to improve the content AI, is to build your own with views and views bulk operations. With it, you can run tasks on many nodes at once, like publish/unpublish and you get all the views filtering / display options you have in any view.
Also checkout http://drupal.org/project/improved_admin - does basically what googletorp suggests for you.

Drupal: Content in blocks from node_reference fields?

After only a few weeks of working with Drupal I've come up with a recurring problem, which I don't really have an optimal solution to, so I'm hoping that someone here might be able to give some best practice pointers.
What I have is a region inside my node.tpl.php, which is populated with blocks that display content from two different CCK fields of the type node_reference. This works fine when displaying a single node. The problem appears when I need to use a view.
For example, lets say I have a news listing, and a single news item view. When I display the single news item I can use the news node node_reference field to reference whatever material I would like to have in my sidebar, but when on the news listing view I would like to reference nodes separately. What would be the best practice to solve this?
I'm having a few ideas, but none seem like the logical choice, how would you do?
My understanding of your problem is that you don't want the blocks to display on the view page and you want the block information displayed inline with the node.
The first part is easy, you can modify the block visibility settings to not show up on the path where you have the view.
The second part will depend on how you set up your view. If you are using fields you can simply add fields for the node_reference and they should display. If you are using a node view, you will have to override the template and create a template which displays the node reference field.
If you want further explanation please comment and I can clarify
After reading my question I realize that it was explained pretty badly, so I'll try again, and also tell how I solved it.
The Problem
On normal "pages" (when displaying only a single node), I have a sidebar that shows something similar to banners, which are either random, or I can select one or many that should always be displayed on the sidebar. This is solved easily when displaying a single node, using a CCK node_reference field. The problem is when using a View that displays multiple nodes, for example a news listing-
The Solution
In my case I could solve this by creating additional fields on my default Page content-type. These fields were called view, display and arguments. In my tpl.php I then embedded the news listing view inside a page, lets call it News. This way I gained great flexibility, and also helps the News page to know where it is located in menu structure.
Final comments
I have yet to discover if there are any drawbacks or dangers in doing this way, but if there are, feel free to share them with me :)
I tend to want to create my own modules, which create blocks and reference the database directly. Then I put the blocks inside of panels, this seems to be more flexible for me than using views and cck fields etc ...

Resources