Project:Block Term
Version:5.x-1.0
Component:Code
Category:task
Priority:normal
Assigned:g.idema
Status:needs review

Issue Summary

I just finished creating a Drupal 6.x port of the blockterm module.

Added functionality:

  • Added functionality to add taxonomy settings to newly created (custom) blocks without having to save them first
  • Added functionality to show the block also on pages containing a child term of the selected term. (Even better would be to make this optional using a depth variable)

Changed installation procedure

Instead of adding code to [yourtheme]_block($block) in template.php, you have to surround your block.tpl.php (or any other block template you use) with the following tags:

  <?php if (!$block->hidden): ?>
  <?php endif;?>

I'm not completely happy with this solution, but it's the best I can do. Please let me know if you found a way to change block visability from within module code.

For testing and deployment, I added a patch from blockterm-5.x-1.2 to blockterm-6.x-0.1.

AttachmentSize
blockterm-6.x-update.patch25.04 KB

Comments

#1

Updated patch

Unfortunatly, the patch I posted before wasn't created from the most recent version and doesn't work properly.
Here's the good patch. Please don't use the previous one.

AttachmentSize
blockterm-6.x-0.2-update.patch 25.71 KB

#2

It seems this module will do just what I need. However, I'm no good with patches, so... Will there be a "proper" 6.x-version released anytime soon?

#3

What's the status of this update?

#4

The status hasn't change since I posted the Patch. Reason is, I don't have permissions to update this project and I haven't heard from the maintainer. Furthermore, I don't use the module myself anymore, as I'm using panels now to achieve my goals.
I'll have a look at it to see if I can somehow update the project. Otherwise, I will post a complete 6.x module in this message.

Gertjan Idema

#5

I tried the patch and got a white screen when trying to configure a block with the module enabled. Any suggestions for troubleshooting?

#6

Could you use this? (Are you already using it?)

http://drupal.org/node/155282
Add db rewriting to blocks query

I think this might get around having to edit block.tpl.php, though I'm not sure.

#7

Ok, I got this working, but when I submit the block with the appropriate terms selected, I get returned to a white screen with the name of the block ($module .'-'. $delta) at the top in fixed-width text, and the URL shows that I'm still pointed at the .../admin/block/configure/... page. I can manually get back to the build/block page, but it's a nuisance, and I'd like to get this cleaned up before I let any of my users try it. Any suggestions?

#8

Also, every block configured is showing up on the calendar page. I could exclude this with the "all except" function, but I'd rather not have to manually configure this for every block I want to display. More to the point, I don't think I can rely on my users to configure it correctly.

#9

Hi,
Will a D6 version be build shortly please?
Would be great to have a version build so specific D6 issues can be made.
greetings, Martijn

#10

subscribing

#11

subscribing

#12

I took another look at the 6.x version of the module this week.
This resulted in a new version with the following changes:
- No more need to modify block.tpl.php, just copy block-ignore.tpl.php to your theme directory
- Some (debugging)code cleanup, which hopefully resolves the white screens (#5 and #7)
- Some code rewrite, to make sure the blocks don't appear on none-node pages (#8)
- @emdalton I had a quick look at using db_sql_rewrite. I think it might work and eliminate the need of the block-ignore.tpl.php file, but it will take some more time to implement and might have some unwanted side-effects.

As for creating an official release, I still don't have the rights to do that, but I'll try to obtain them. For now I'll attach a zipped version of the module to this comment. Please let me know what you think of it.

Gertjan

AttachmentSize
blockterm-6.x-0.3.tar_.gz 8.05 KB

#13

Thanks g.idema - great module!

I enhanced it to include a permission used to specify which roles see and edit the taxonomy settings.

AttachmentSize
blockterm-6.x-0.4.tar_.gz 9.4 KB

#14

In the meantime until there is a stable 6 version:
If you want to show content with the same taxonomy terms as the shown node in a block, using Views.
http://drupal.org/node/450786#comment-1542476

Just import the given code as a new View and Save.
Take care. The given solution only shows content:

  • with exactly the same taxonomy terms (AND = ,). To show all nodes that have at least one term in common you should use OR ( = +). 
  • of the same content type. If you want other content types, delete the Content Type field in the Arguments and use the regular Views Filter instead.

#15

Hi,
I have enhanced the 6.x-0.4 revision further to work without the need of a template file(block-ignore.tpl.php).
Another feature is a checkbox on block configuration form to enable functionality of block-by-term module. If this checkbox is not checked, the block behaves normally.

The patch(blockterm-6.x-0.5-update.patch) provided below, is for 5.x-1.x (GIT HEAD) revision.

The second patch(blockterm-6.x-0.5-update.module.patch) is for 6.x-0.4 revision

AttachmentSize
blockterm-6.x-0.5-update.patch 10.12 KB
blockterm-6.x-0.5-update.module.patch 2.54 KB