By tip on
Hi,
is it possible to associate somehow a picture with a taxonomy term? For example image would be shown next to each story on the main page.
Thanks.
Hi,
is it possible to associate somehow a picture with a taxonomy term? For example image would be shown next to each story on the main page.
Thanks.
Comments
Look at taxonomy_context and
Look at taxonomy_context and node_image.
problem with terms
I've installed both modules successfuly (taxonomy_context and node_image), going to the administration -> taxonomy I still can't add images to my terms, am I missing something ?
I just got this working...
It is possible to do this. You must modify your chosen theme (I used xtemplate) as is directed in the INSTALL file with node_image. I used the node_image CVS version and then applied the patch from:
http://drupal.org/files/issues/imaged_nodes.patch
and suddenly everything worked. Still working out the kinks, but it seems to be working.
how to upload images for taxonomy terms with node_image answered
In case you or someone else is still looking for the answer..
I was looking like mad for the place of image upload for terms... then I found it. You have to have taxonomy_context for this to work though, I think. Taxonomy_context puts the description of your taxonomy term in a message box directly under the taxonomy title on taxonomy pages like /taxonomy/page/or/10. In this message box, there's a link called "add images" which allows you to upload and associate an image with that taxonomy term.
I made a feature request for
I made a feature request for this feature here
f. request
I think this feature is a must for drupal. I've got PHP/SQL skills(nextgencms.sf.net), but where to begin? ;)
So do I! (as I tried to expla
So do I! (as I tried to explain in my feature request)
I know that the Polder theme does have this feature... but there isn't a version that works with Drupal 4.4.x. yet But the author Robert Polder say's he's working on it...
Perhaps you could dive into the polder theme and have a look at how he's done it?
I have implemented topic images in my theme
This solution is a bit primitive but it works. All is done in the function name_of_theme_node.
Then you just put $termimage where ever you want the image in the node. Remeber to remove the php open and close tags if you cut and past. See it in action at http://xdeb.org/.
nice =) I'll give it a go..
nice =) I'll give it a go..
utmärkt..
In what source file ?
Dear frjo !
I have searched for your posted code in the Drupal folder but couldn't find the mentioned function to insert the code in ( function name_of_theme_node ) . Would you please tell the place in Drupal directory tree ?
Thanks a lot ,
It's the node function in your *.theme file
I use my php theme "Slash" that borrows a lot of code from "Chameleon", the php theme in core.
If you use a xtemplate or a phptemplate theme it will be more work to implement this hack.
How to use the image ?
Dear frjo !
I managed to insert the hack without problems into my slash theme .theme file. What remains now is how to use an image as a topic image. I made a folder in the root drupal directory and created topics folder inside it and put a PNG test image. How can I use it now ?
Thanks a lot for your help !
In the array $topic_images
In the array $topic_images you must pair up a term id with a image file name.
Then you just put $termimage where ever you want the image in the node. See example below.
As I mentioned in my original comment, it's a primitive hack.
Image tag gets converted to textstring
Even if this thread is a bit old I hope someone maybe can help with this problem.
I've included the above code in my .theme file and the page generates just fine. My problem is that the image tag string gets converted to at text string in the output, so instead of the category picture I see the full
tag text with all its attributes as an anchor. I guess it must be something with l-function, but I can't figure out how to get around it. Has anyone had the same problem and managed to solve it? I run Drupal 4.6.3 my server.
You need to add some
You need to add some attributes to the l function. Here are the updated code.
Great! Now it is working.
Great! Now it is working. Thank you very much!