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.
Comments
Comment #1
Anonymous (not verified) commentedUpdated 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.
Comment #2
janne commentedIt 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?
Comment #3
Flying Drupalist commentedWhat's the status of this update?
Comment #4
Anonymous (not verified) commentedThe 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
Comment #5
emdalton commentedI tried the patch and got a white screen when trying to configure a block with the module enabled. Any suggestions for troubleshooting?
Comment #6
emdalton commentedCould 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.
Comment #7
emdalton commentedOk, 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?
Comment #8
emdalton commentedAlso, 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.
Comment #9
summit commentedHi,
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
Comment #10
skizzo commentedsubscribing
Comment #11
federico commentedsubscribing
Comment #12
Anonymous (not verified) commentedI 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
Comment #13
bwinett commentedThanks g.idema - great module!
I enhanced it to include a permission used to specify which roles see and edit the taxonomy settings.
Comment #14
lolandese commentedIn 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:
Comment #15
nanobyt3 commentedHi,
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