Taxonomy List looks different in Block
jessicakoh - October 22, 2008 - 21:04
| Project: | Taxonomy List |
| Version: | 5.x-1.4 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | NancyDru |
| Status: | closed |
Description
I have both taxonomy image and taxonomy list installed.
I am able to view my terms in the page,taxonomy/vocabulary/5, displayed 4 items in a row. That what I want.
However, when I add a block of the above in the "content" region, the taxonomy images are arranged one in each row (zebra).
Questions:
1. How do I override the theme, so that it displayed 4 items in a row, just like what I have in "taxonomy/vocabulary/5"?
2. Alternatively, how do I display "taxonomy/vocabulary/5" in a block in the "content" region?
Thank you for your time.

#1
Hmm, I'll have to look and see if this can be done. I think I never considered full width blocks when I decided to force block to one wide.
#2
I'm not crazy about this, but it should work: In your block, include this PHP code:
taxonomy_list_show(5, 'all', 'block', 4)Where "5" is the vocabulary and "4" is the number of columns.
#3
<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?>">
<?php if ($block->subject): ?>
<h2><?php print $block->subject ?></h2>
<?php endif;?>
<div class="block-content"><?php print $block->content ?></div>
<?php taxonomy_list_show(17, 'all', 'block', 4) ?>
</div>
Even if I put
<?phptaxonomy_list_show(17, 'all', 'block', 4)
?>
I have tried Views. Did not workout yet.
Am I in the right direction? Should I be working in Views Taxonomy Image or modify Taxonomy List?
Please advise. Take a look at the attachment.
Thank you for your time. Appreciated.
#4
Your first snippet is theme code, which is not what you asked about. The second snippet is what should be in a PHP format block under admin/build/blocks. It is essentially the same code that the module would call and should properly build the block contents the same way the module would.
#5
I see.
It did not work. Here is the screenshot.
Thank you for being helpful. :)
#6
What did it do?
#7
1. Add Block.
2. Type the snippet below
<?phptaxonomy_list_show(17, 'all', 'block', 4)
?>
3. Input type - PHP
4. Add the block in the "Content" region.
No result. Did I missed out something?
#8
I did this and it worked fine:
<?phpif (function_exists('taxonomy_list_show')) {
return taxonomy_list_show(3, 'all', 'block', 4);
}
else {
return 'oops';
}
?>
#9
You need the "return"
#10
Thank you, Nancy.
It works. Yeah, you aright, I missed out the "return".
One more minor problem, the taxonomy list (images) is 32 x 32 pixel. How do I use the "Original" size, as what I have with "taxonomy/vocabulary/5"?
I appreciate your patience.
#11
I'll have to do some more digging after church because I don't remember off the top of my head why it would be different. Obviously, I need to do some block clean up in version 2.
#12
Change
return taxonomy_list_show(3, 'all', 'block', 4);To:
return taxonomy_list_show(3, 'all', NULL, 4);#13
Thank you, NancyDru. This solved the problem.
I am opening up taxonomy_list.module to learn more.
Thank you for your time. Appreciated.
#14
Jessica, don't spend too much time because version 2 is coming soon and it is quite different. And, BTW will come with a theme_taxonomy_list_block.
#15
Thank you.
Love it.
Keep up the good work.
#16
Automatically closed -- issue fixed for two weeks with no activity.