Here is a patch against 7.x-1.0 that extends CCK Blocks to work with taxonomy and user fields, and creates a CCK Blocks display mode for both, just as already exists for node objects.

Some things need to be looked at - I havent tested it with terms in fieldgroups, and token integration may not be the best (I set it up so node tokens work on nodes, and term tokens work on term pages, but I left user page tokens out for the moment in case there is some conflict with the 'current user' tokens.

However, I guess it's a start :)

Comments

doublejosh’s picture

Love it.
Wish there was a Drupal 6 version of CCK block to easily place terms of a specific vocab into a block on a node page.

dubs’s picture

It would be great to see this applied. This is really useful functionality. Can this be applied to the latest DEV?

damien_vancouver’s picture

Version: 7.x-1.x-dev » 7.x-1.0
Status: Needs work » Needs review

Hi guys,

I had a look through this patch (which predates my arrival to cck_blocks as a maintainer)... I don't see any reason why we wouldn't add this to -dev. It's great extra functionality and it looks like it would be totally backwards compatible.

However, I won't have much time to test it exhaustively.. if I get it into -dev, could someone on the thread here give the new functionality a good test for me? I"ll make sure that existing functionality still works as it did... then we can maybe leave it in -dev for a bit and if there are no issues come up push it to a proper suggested release.

There's a couple other enhancements for cck_blocks to play nicer with other modules that we could get into the release too, like #1509566: Improve compatibility with other modules (Nodesymlinks and Workbench Moderation, and others) and maybe also #1720502: Field content in CCK subgroups not shown in blocks that would be nice to get into a new stable version.

So, I will try and get this patch re-rolled against 7.x-dev later today (unless someone beats me to it) and applied for testing.

damien_vancouver’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs review » Needs work

Setting to correct version and issue status.

dubs’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Needs review » Needs work

I will help to test - we use this module extensively. As soon as it's ready I'll download and feedback.

damien_vancouver’s picture

Status: Needs work » Needs review
StatusFileSize
new8.75 KB

OK, I cleaned up the original patch - a working one is attached.

I've also committed the patch to 7.x-1.x-dev in commit 30e347e : Taxonomy and User field support

It's ready for some testing now.

I did make some other changes:

  • I commented out some enhancements to support fieldgroups. These look good, but they should be addressed in a separate issue. We can test and add support for fieldgroups of terms and users at the same time.
  • I reverted some of the logic inside the node entity code so it matches exactly what code was running before. My rationale for this was to make as few changes as possible, and not to break any current behaviour going on with the 6000 or so installs of the module. Among other things, the change included running node_build_content() to prepare the node, which fires all sorts of hooks. I edited the old code to use the new object name (ie. $node becomes $entity_object ) but returned the old logic into place.
  • I added static caching for the terms and users, just like the $node had. I also updated the static declarations to use drupal_static

Please give the user/terms some real world testing with 7.x-1.x-dev and let me know how it goes. I will be implementing some other fixes over this week, in hopes of making a new 1.x point release by the end of the month.

damien_vancouver’s picture

Status: Needs review » Fixed

I'm tidying up open issue statuses, so I set this to its correct value of "fixed" since it's been committed.

I'll close this issue as well once the 7.x-1.2 release comes out. Any testing in the meantime (using 7.x-1.x-dev) would be appreciated!

Status: Fixed » Closed (fixed)

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

petednz’s picture

thanks for the work on this

Just reporting back on testing - basically it all seems to work though I had problems getting 'CCK Block' button to show under Manage Dsiplay for a while.

Downloaded dev and enabled - saw no DB updates to run
CCK Blocks checkbox now appears already ticked under
Use custom display settings for the following view modes
but does not show as a button under Manage Display

Unchecked and checked again

(didn't try clearing caches - maybe that would have resolved it sooner)

No change but get the message The CCK Blocks mode now uses custom display settings. You might want to configure them. at
/admin/structure/taxonomy/blog_title/display/cck_blocks

but got access denied there (as admin!)

checked Taxonomy Term Page to confirm I see that as a button. I do.

Rechecked CCK Block and finally my button showed.

Not sure that problem is replicable though ;-(

Might be worth seeing if anyone else can confirm the hiccup I hit.