views:

25

answers:

1

I've created a drupal views Attachment display that lists a bunch of nodes. How would I add this to a content type? I've seen examples that require changing the template files, but can views Attachments be used without making changes to the theming layer?

+3  A: 

Views attachment displays attach the display to another display within the same view: look at the Attachment settings block on the attachment display. The use case for this is if you had, say, a summary view and a detail view that had to appear together: you'd attach the detail view display to the summary view display.

If you want a view to show up on pages other than the view itself, you need to create a block display. Then, you have two choices:

  1. If you want it to show up in a region defined by your theme (i.e. as a regular block), just go to Site Building -> Blocks and move the newly created block to whatever region you want.

  2. If you want it to show up as part of a node, you need View Reference, which creates a CCK field that lets you select a view. That field can be positioned anywhere in your node template like any other CCK field.

Mark Trapp
You define displays on the view and choose which displays a view reference can select within the field's settings on Manage Fields. If you keep the display for the view reference field to the default setting, it'll use the view display you selected as if it were in a block or a page by itself. Sounds like you're looking at the wrong live preview for the display you selected with your view reference.
Mark Trapp
Something's not working there, but can't figure it out. The view is supposed to accept a comma delimited argument and return multiple items, but it returns only one. When I check with dsm or even set the argument programmatically, it still returns just a single item. But when I test with the views interface, I see all items.
Berming
If you're providing a default argument to the view, there should be no difference between what you see in the Views configuration and in the block itself. Check your default argument handling code and make sure you're previewing with the correct display.
Mark Trapp