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

NancyDru - October 24, 2008 - 13:01

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

NancyDru - October 24, 2008 - 13:09
Assigned to:Anonymous» NancyDru
Status:active» postponed (maintainer needs more info)

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

jessicakoh - October 24, 2008 - 14:33

<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

<?php
taxonomy_list_show
(17, 'all', 'block', 4)
?>
, would I get the "original" size taxonomy image as in Taxonomy Image?

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.

AttachmentSize
tax2.jpg 77.54 KB

#4

NancyDru - October 25, 2008 - 16:06

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

jessicakoh - October 25, 2008 - 16:51

I see.

It did not work. Here is the screenshot.

Thank you for being helpful. :)

AttachmentSize
block.jpg 61.76 KB

#6

NancyDru - October 26, 2008 - 01:37

What did it do?

#7

jessicakoh - October 26, 2008 - 01:54

1. Add Block.
2. Type the snippet below

<?php
taxonomy_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

NancyDru - October 26, 2008 - 02:47

I did this and it worked fine:

<?php
if (function_exists('taxonomy_list_show')) {
  return
taxonomy_list_show(3, 'all', 'block', 4);
}
else {
  return
'oops';
}
?>

#9

NancyDru - October 26, 2008 - 03:02

You need the "return"

#10

jessicakoh - October 26, 2008 - 04:19

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

NancyDru - October 26, 2008 - 12:44

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

NancyDru - October 27, 2008 - 13:57

Change return taxonomy_list_show(3, 'all', 'block', 4);

To: return taxonomy_list_show(3, 'all', NULL, 4);

#13

jessicakoh - October 27, 2008 - 14:18

Thank you, NancyDru. This solved the problem.

I am opening up taxonomy_list.module to learn more.

Thank you for your time. Appreciated.

#14

NancyDru - October 27, 2008 - 23:37
Status:postponed (maintainer needs more info)» fixed

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

jessicakoh - October 28, 2008 - 00:00

Thank you.

Love it.

Keep up the good work.

#16

Anonymous (not verified) - November 11, 2008 - 00:02
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.