I'm having the same problem described at http://drupal.org/node/73058 -- when inserting a view into a custom CCK node, all that wil display is the insert-view code itself. (ie, [view:key_issues_articles=5=20] or [view:books])
The input formats have been configured to allow for [view:viewname] tags. And I've tested with a standard Drupal page node -- views will insert just fine in that.
Here's our installed version info for the relevant modules:
// $Id: insert_view.module,v 1.5 2006/07/04 14:43:58 eaton Exp $
// $Id: content.module,v 1.64 2006/06/12 19:36:54 JonBob Exp $
// $Id: views.module,v 1.141 2006/06/25 18:24:56 merlinofchaos Exp $
And for whatever it's worth, the following PHP *will* insert a view into a CCK node (assuming the input format is set to allow php, of course):
echo 'php test';
$view = views_get_view('books');
print views_build_view('embed', $view, array(), false, false);
Any suggestions? Thanks in advance for your help.
TKS
Comments
Comment #1
eaton commentedInsert views doesn't work with custom-themed CCK fields. It's an unfortunate consequence of 1) the fact that insert_view can't use the normal filter mechanism because its contents can't be cached, and 2) the fact that custom-theming a CCK node (or using contemplate.module) causes the $node->body field to be ignored.
The same problem occurs using inline.module, upload.module, freelinking.module, or any other module that does its work in nodeapi($op == 'view'). I consider it a limitation of CCK at the present time.
As you noted, using straight PHP in the themed CCK node is the best solution right now.
Comment #2
TKS commentedWell, at least I know we're not overlooking something obvious....
Many thanks for the quick reply.
TKS
Comment #3
dkruglyak commentedThis proposed solution just isn't good enough... Using straight PHP in themed CCK node is too much trouble.
I looked at how filter module implements caching. There is a check for whether caching is allowed that is done through filter_format_allowcache function. Why cannot insert_view provide a format configuration option (for example like url_filter does) to prompt the user to turn off caching for that format?
Could you think of any reason why this approach might not work ???
Comment #4
merlinofchaos commentedI recommend trying this and submitting a patch; insert_view is a fairly straightforward module, and filters are pretty straightforward too.
Comment #5
dkruglyak commentedI just identified another possible solution - one that could fix all other broken filters in CCK: http://drupal.org/node/109293
Any thoughts about pros and cons of these two approaches?
Comment #6
mlsamuelson commentedUpdating to version 5 and marking as fixed. (I no longer have plans to actively develop for 4.7.)
Issues http://drupal.org/node/224987 and http://drupal.org/node/180042 mean Insert View tags now work in CCK fields that use Insert View enabled input formats (for the 5.x and HEAD versions of the module).
mlsamuelson
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.