Hi,
Any idea how I can place an attached view before (actually, to the left of) the node.
The site/view I'm working on is here: http://studiosundew.com/gallery & I've attached the view used to create.
I'm attempting to build a gallery as in Jeff Eaton's post on Lullabot:
http://www.lullabot.com/articles/photo-galleries-views-attach
I have every other aspect working properly, but this has beaten me! Despite several hours of searching, trying things out and eventually banging my head on the keyboard! :-)
I can't see how I can do this simply with CSS (I've tried, oh yes, I've tried!), but maybe I'm missing something. Many thanks.
Matthew
| Comment | File | Size | Author |
|---|---|---|---|
| gallery_photos_view.zip | 2.09 KB | mshepherd |
Comments
Comment #1
steinmb commentedNot 100% sure that I understand your problem. Views attach is a view that get added to the node object when it get rendered. This makes it hard to print the view from whin page.tpl.php. BUT are you trying to change the order, wrap part of the node ouput div's etc to enable you to control the layout from CSS views attach is still correct module to use.
Views attach get added to the $content variable so you can either change the variable from template.php or within node-something.tpl.php. You could start with creating a node-xxx.tpl.php and remove the line that print the $content variable. This give you a bit more control. For a simple image gallery all you need from the $content variable is perhaps node title and node content (body) and you end up with something like:
The above code is just an example, you need to change it to match your config.
Comment #2
mshepherd commentedThat looks like just the pointer that I needed. Many thanks.
I'll post back with some more notes on how I got it to work.
Thanks again.
Matthew.
Comment #3
mshepherd commentedThanks again. I've got it sorted now.
I copied node.tpl.php to node-gallery.tpl.php file (gallery being the content type) and flushed the theme registry. I then changed the following lines:
to:
This meant that my galleries, away from the gallery listings page, got printed properly. A little CSS floated the image to the left so the text flowed to the right:
Comment #4
mshepherd commentedComment #7
jstollerThis would actually be a very useful feature. I would love to see an option in the Views configuration to place the attachment either above or below the node's content.
For instance, right now I'm trying to place a slideshow view at the top of certain pages. Views Attach would be perfect if I could just check a box to put my view up there. As it is, I will probably forgo this module and just create a block, witch seems far simpler than hacking the template as described above.
Comment #8
Crell commentedI don't understand the issue here. Just attach the view to the appropriate node type, then go to the Manage Fields tab for that node type and drag the view to the top of the list. Or bottom of the list, if you prefer. Poof, the view is embedded above any of the content in the node.
If you mean putting the view elsewhere outside of the $node->content array, then that is not what this module is for. You probably want Panels instead.
Comment #9
jstollerMy bad. I completely missed that feature when I was working on this. This module is way more awesome than I thought. :-)
Comment #10
Crell commentedComment #11
mshepherd commentedIt probably wan't clear in my original post, but I think I needed the order to be different in different places.
Comment #12
Crell commentedmshepherd: That is not possible in Drupal 6 due to limitations of CCK. The same order is used everywhere.
Comment #15
mikiciuk commentedI'm having a similar problem except I'm using a "node content" display instead of an "attachment." I'm displaying the photo album's as teasers that only show the album title, and then using a "node content" to display the most recent image from each album to append to an album teaser. By default the album title is above the most recent photo. I've tried going to my album content type and moving the view to the top of the list, but that doesn't work. I'm obviously missing something. Any ideas?