Closed (fixed)
Project:
Acidfree Albums
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
12 May 2007 at 10:32 UTC
Updated:
15 Oct 2008 at 10:52 UTC
I'm using Acidfree for the photo gallery on one of my sites (www.maceiras-alentejo.co.uk) and when viewing an image there is a little icon and a link to the taxonomy type of the image displayed just above and to the left of the image itself as can be seen at www.maceiras-alentejo.co.uk/node/97
How do I either:
1. remove the image and link (preferable)
or
2. move them below the image?
Comments
Comment #1
nancydru+1 for me. Except in the Garland theme they are below the image.
Comment #2
Dubber Dan commentedAh, then that suggests it might be controlled within the theme and not the module....
Still need to know what to alter though ;-)
Comment #3
nancydruIt can be done in the theme. All I know is that you will see a "print $links" somewhere.
However, IMHO, it is better done on the module, but I am not the AcidFree developer. In a module that I wrote, I have an option to generate (or not) the links. I haven't looked at AcidFree, but I know how it can work in Drupal, and it would be harder (although fairle easy) to add the settings option than to actually do the code to do the links.
Comment #4
vhmauery commentedI agree that this is mildly annoying. However, until now I have not investigated it.
The links are generated by the Taxonomy module, not Acidfree. Since they aren't even part of the node->content that is found in nodeapi('view'), Acidfree can't even modify them there. The only way to get rid of them that I can think of would be to special case the view node theme so that for Acidfree types ('acidfree', 'image', 'video') you don't display the taxonomy links.
I am marking this as won't fix, but it is more of a "can't fix".
Comment #5
nancydruVernon, they should be visible in the hook_link_alter function. Something like this:
But, much easier is if you set the vocabulary as belonging to AcidFree ($vocabulary->module = 'acidfree'). That will cause the taxonomy module to call a hook_term_path in AcidFree rather than creating a taxonomy term link. You can then do whatever you wish with them.
Comment #6
vhmauery commentedRight. I had forgotten about hook_link_alter. Thanks for reminding me. I just committed a fix for this. Basically, since it is an annoying feature, by default, the links are gone unless you elect to have them shown in Acidfree settings.
Committed to CVS.
Comment #7
nancydruOh, darn, I was hoping you'd take the hook_term_path approach... I'm itching to have an established contributed module use that because I have an issue open with the API documenters.
Comment #8
Dubber Dan commentedGreat news!
Now all I need to do is figure out how to get it from the CVS to my site. Any pointers folks?
Comment #9
nancydruIt should be part of the 5.1-dev download tomorrow.
Comment #10
vhmauery commentedIf you look at the diff, I actually implemented both hook_term_path and hook_link_alter. Oh. But I just realized that I forgot to modify the existing vocabulary with acidfree.install. But it looks like I am in time for the next scheduled tarball creation, so it should all be atomic from your point of view (unless you are using CVS).
But I implemented hook_term_path so the taxonomy links now look link back to the album node rather than the taxonomy term, so you should never see a link to the term listing of an album.
The hook_link_alter was required to actually remove the links. Even if hook_term_path returned null, the links still showed up, so I finally resorted to just deleting the taxonomy links that were from the Acidfree vocabulary.
Comment #11
nancydruHmm... I downloaded today (the May 14 version) and see the "Show category links in Acidfree node views" on the settings page, but it doesn't matter if I check or uncheck this. The links are still there. BTW, I am using the Garland theme.
Comment #12
nancydruComment #13
vhmauery commentedNo, it works just like I wrote it. It gets rid of the Acidfree vocabulary category links. All other vocabularies still will show their links. The other vocabularies' categories *should* show up. The only real reason for removing the Acidfree vocabulary categories is because it is redundant with the breadcrumb links.
I just don't think it is right for Acidfree to run off and destroy ALL of the category links.
Comment #14
nancydruOh, I see. It's my TAC_Lite links that are showing...
Comment #15
nancydruFor those who wish to eliminate all taxonomy links, here's a snippet. I put this in another module's hook_link_alter just because it was easier to put it there.
Comment #16
adaven commentedThanks I found this post very useful. Just one point, some themes put text before the taxonomy term, such as "in" or "belongs to", which can still appear even when
$links[$module] = array()A way to fix this is to callunset($links[$module])instead.