Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#9 | views_attach-746556-9.patch | 1.49 KB | gaurav.kapoor |
#7 | views_attach-746556-7.patch | 879 bytes | c4rl |
Comments
Comment #1
c4rl CreditAttribution: c4rl commentedI 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.
Comment #2
beauz CreditAttribution: beauz commentedI'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?
Comment #3
c4rl CreditAttribution: c4rl commented@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.
Comment #4
beauz CreditAttribution: beauz commentedOk 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?
Comment #5
becw CreditAttribution: becw commentedNo: 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.
Comment #6
gregglesSo, let's document it somewhere?
Comment #7
c4rl CreditAttribution: c4rl commentedAdded paragraph to README.txt
Comment #8
becw CreditAttribution: becw commentedI 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.
Comment #9
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedThanks for the patch @c4rl , modified it lil according to coding standards.
Comment #10
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commented