If you are organizing all the node content on a node using views attach and make your cck fields hidden then the preview will show nothing.

I'm not sure this is really possible to solve, but it's worth noting somehwere (like the README.txt).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

c4rl’s picture

I think the lesson here is that views_attach shouldn't be used as the principal method of rendering content for a node if previewing is going to be important.

beauz’s picture

I've got a site that requires this, is anyone able to explain to me why this is not possible?
Is there some method to get around it?

c4rl’s picture

@beauz

The issue is that the Views Attach module often receives arguments from the node to populate the view. In the case of authoring a new node, the node does not yet exist in the database during preview and thus certain fundamental properties of the node (such as the node id) do not yet exist.

In my own use of this module, there were certain circumstances wherein I discovered writing a CCK formatter was a better solution to achieve similar functionality.

beauz’s picture

Ok yep this makes sense...

The site i'm working on will on need the preview on existing nodes (node edit not node add) do you think there is any way to hack it just for this case?

becw’s picture

Status: Active » Closed (won't fix)

No: because CCK fields aren't saved during a node preview (whether for a new node or updating an existing node), there is no way for Views to get the information.

greggles’s picture

Title: Views attach doesn't show on node preview » Document that Views attach doesn't show on node preview
Component: Code » Documentation
Category: bug » task
Status: Closed (won't fix) » Active

So, let's document it somewhere?

c4rl’s picture

Status: Active » Needs review
FileSize
879 bytes

Added paragraph to README.txt

becw’s picture

I feel like that's a very use-case specific caveat; plus, nowhere else is Views expected to handle nodes in the "preview" state. But clearly folks are using Views Attach to render a replacement for node bodies, so maybe you've got a point.

gaurav.kapoor’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
1.49 KB

Thanks for the patch @c4rl , modified it lil according to coding standards.

gaurav.kapoor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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