D6 introduced the idea of a build_mode which is perfect for print module. CCK even offers a UI so admins can specify which fields are shown or hidden when in the print mode for each content type. The attached patch implements the CCK hook so we show up as a subtab on its Display Fields form (e.g. admin/content/node-type/news/display/print).

This patch does not remove $node->printing = TRUE but it effectively does the same thing.

Note that cache clear is needed to get the tab to appear in CCK.

CommentFileSizeAuthor
mw.patch2.7 KBmoshe weitzman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jcnventura’s picture

Status: Needs review » Fixed

Hi,

Thanks for the patch! I have committed it to CVS.

João

jcnventura’s picture

Hi moshe,

Is it possible that your patch caused the problem described in #359343: A few things broken(?) in the lastest dev release?

João

jcnventura’s picture

Status: Fixed » Needs review

Reverting this patch until the cause of #359343: A few things broken(?) in the lastest dev release can be determined.

jcnventura’s picture

Status: Needs review » Needs work

Issue #359343: A few things broken(?) in the lastest dev release is caused by this patch... Maybe there needs to be a check of some sort around the $print->build_mode line for some dependency on a specific cck module version?

pwolanin’s picture

the build mode should be set (following book module in core) as:

 $node->build_mode = NODE_BUILD_PRINT;
jcnventura’s picture

Status: Needs work » Closed (fixed)

Indeed, taking into account the fact that core provides a perfectly acceptable build mode, I think that the line indicated by pwolanin in #5 is all that is needed.

I'm going to commit the above when possible. The build mode issue is now being tracked in #428024: hook_link and hook_nodeapi problems.

João