I know that this might sound really boring for all those in the know but having struggled with this module in its previous and current incarnations I'm just about to give up.
So could someone please give a simple example of code that one can put in to a page.tpl template file so that the images show at the to of a listing for a taxonomy term.
Much appreciated.
--
Ade Atobatele
Comments
Comment #1
nancydruI appreciate the urgency you may feel, but this is simply not a critical issue.
If no one else comes up with something, I'll play around with this and see what i can do.
Comment #2
Nigeria commentedThanks...
Waiting with bated breath...
Comment #3
nancydruFor information on changing your themes, I suggest the handbook section: PHPTemplate theme engine
For example, Bluemarine has:
<h1 class="title"><?php print $title ?></h1>You should be in business now.
Comment #4
nancydruComment #5
Nigeria commentedThanks a million...it works...well almost!
It works on a URL like http://www.example.com/taxonomy/term/948 but not its equivalent http://www.example.com/category/1/948
So what do I have to add to get it to work with categories as well as taxonomies :)
---
Ade Atobatele
Comment #6
nancydruSubmit a well-tested patch. http://drupal.org/node/145836
Comment #7
Nigeria commentedBased on your code and others, I managed to cobble together the code below which works in page.tpl.php for both taxonomy term pages and individual nodes.
In this instance terms have only one taxonomy image per term, while nodes can have multiple taxonomy terms associated with them.
I also use Path Redirect to redirect the image links to wherever I want them to go based upon the taxonomy term that they represent.
In this case I've created it to create a non-existent URL ../jump_to/xxxx (where xxxx is the name of the relevant term) which ensures that Path Redirect picks it up and does the appropriate redirection.
This hasn't been exhaustively tested, so I can't guarantee that it'll work in all cases.
--
Ade Atobatele
Comment #8
nancydruThanks for the feedback. Would you like to add this to the "Real Life" examples in the handbook documentation?
The Taxonomy Image Link Alter add-on will automatically take care of the taxonomy links. However, it will not set the path as you are doing. For that case, the Taxonomy Redirect module could be used. Or I think the TILA module could be modified to allow a base path option.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #10
Nigeria commentedI almost thouight that I could follow your suggestion and put it as a handbook entry, but I've been testing the code that I uploaded and have found a bug.
If you put the code in a block the title and term names disappear while the image itself gets shown. Any idea why?
-- Ade Atobatele
Comment #11
nancydruWhich code is that? Template and block code won't be the same.
Comment #12
Nigeria commentedAhhh................
What should the block code look like to be able to have the same functionality in a block?
I wanted to put it in a block, so that when in edit mode or admin mode the image, and its associated link, doesn't show.
Firstly this is following the principle that you should not give a user an option that you don't want them to actually exercise. When in either of those modes I just want the user to finish the immediate task rather that be able to jump out of the page leaving the task undone!
Secondly I need all the real estate possible when in admin mode on my fixed width template. Being able to put the code into a block allows me to use the block's configuration settings to hide the block when necessary.
--
Ade Atobatele
Comment #13
nancydruI still don't know what code you're talking about or what your goal is. If you're talking about a block that shows the image associated with the terms for a node, there is a contributed module for TI that already does that.
Comment #14
nancydruobviously not too urgent
Comment #15
Nigeria commentedUrgent..but had a mighty cold, so went straight to bed!!!
Didn't realize that you had a new version out...looked at it and it does most of what I want...I might hack it though and get back to you.
-- Ade Atobatele
Comment #16
nancydruThere have been several versions since 5.x-1.1-beta1. The absolutely newest stuff, including caching, is in the 5.x-1.x-dev version.
Comment #17
nancydruNo comment, closing.
Comment #18
Nigeria commentedI just noticed that
if ($image = taxonomy_image_display(arg(2))) {
print $title . "" . $image . "";
}
acts in a recursive manner whether or not the recursive flag is set. It even overrides individual settings in terms in term view. It works properly in node view (i.e. it does nothing)
I'm on the 5.x-1.x-dev version.
Comment #19
nancydruWhen you say you're using a -dev version, it's a good idea to also tell what the date is on it. 5.x-1.3 should be out any moment and I strongly encourage trying it.
Comment #20
Nigeria commentedI'm now using the 5.x.1.3 version and the feature/bug still persists