Closed (fixed)
Project:
Taxonomy Image
Version:
5.x-1.3
Component:
Contrib Link Alter
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Jun 2008 at 15:20 UTC
Updated:
2 Feb 2009 at 19:10 UTC
I have some issues with the display of images in Table form Views:
The best option to solve these issues would be to enable the "Link Alter" module to enable it in these table views. For example add a "As image" to the display options of the field in the Views setup.
Would it be possible?
Comments
Comment #1
nancydruIf Views creates them with hook_links it would be. But I don't think that's what Views does. I don't know Views well enough to answer this. I'm not even sure how to set up a test case.
Comment #2
AD-DA commentedOK, I did a quick check on the views module. Taxonomy is managed in a sub-module in
views_taxonomy.inc.Below is a "quick and dirty" solution which seems to work for me, but it should be possible to use proper overloading of hooks and handlers to manage this.
First add a new display option in the view definition table:
Then change the handler to enable the display of images
The issue comes from the way Views creates the taxonomy links. Probably for performance, it creates a new blank node object where it just copy the taxonomy terms. The node type information does not seems to be available in the data which is sent to the handler. Which means that we need to query the database to get the node type. I just used a node_load, a specific query would be more efficient, but there is probably a better way to manage this.
An other way to solve this issue would be to change the type check on Taxonomy image side:
This second solution should be more efficient, but it circumvents the Taxonomy Image content type set-up, and override it by the setup of the Views table.
As I am quite new to Drupal, advices on how to manage this properly is most welcome.
Comment #3
nancydruHave you submitted a feature request on Views? If so, please post the issue number here.
There may be a way to refactor the testing so that the type checking is still done first.
Comment #4
AD-DA commentedYes I just did: #274378: Enabling Link Alter in Views
and I updated my previous comment with a solution based on changes on Taxonomy Image side.
Comment #5
nancydruCan you roll this into a patch, please?
Comment #6
nancydruWhen you have time for a patch, please mark this issue active again.
Comment #7
nancydru