I'm building a site where some pages have sidebars, not in the usual web design sense of the word, but more like you'd see in a book, with some material related to the page that I'd like to show in the second sidebar region. I saw this forum thread, wherein Krystee advises to hide the field from the normal display and use Views to display it in a block.

I'm not really up to speed on Views, though, so I'm not quite sure how to get this working. I've gotten as far as a View that displays my sidebar field, and I've put the block into the right region, but it's pulling all the sidebar blocks from all the pages that have them, and displaying that entire list wherever the block appears. Basically, I want to add "WHERE nid=$nid" to the query so that it will only display sidebar fields from the current node. I haven't had much luck in figuring out how to do that, though.

Thanks—I'm sure this is pretty straightforward for someone more familiar with Views.

Comments

ee21k’s picture

sounds like you want to use 'blocks' create a custom block in 'sidebar-last' and use the full html submission to run a script to grab and display your content.

If thats what you were aiming for. not entirely sure.

jefgodesky’s picture

That'd probably be easier for me, since I know PHP pretty well. But it seems like Fields and Views is the cleaner way to do it, and it's something I really need to get used to.

With a little help from this blog post and finally wrapping my head around the idea that arguments in Views automatically become filters, so I don't have to create a filter that uses the argument, I managed to get it all working the way I want. Thanks!