0
votes

I'm using Views in Drupal to show node teasers. I would like now to show the complete node on the left side of my page, nearby the Views, and update it when the user click on a different teaser (better using AJAX).

what's the best method to implement it. I was considering to use a lightbox, but it a bit complex (a lot of complications... such as parsing the content with javascript again.. etc).

See screenshot: http://dl.dropbox.com/u/72686/viewsAndNode.png

Thanks

3

3 Answers

0
votes

A quick and dirty approach would be to use an iframe to hold the node content. Users would then be able to switch between nodes without reloading the page, which is I assume your goal. I don't think there is away to achieve what you are trying to do with views out of the box. Have you looked into using panels?

0
votes

Here's what might be a clean way to do it, of course in drupal there's always many ways to accomplish things.

Providing the content for the ajax call

  • Install the services module
  • Setup a service that provides your node as you want it to be displayed

Create the placeholder for your content

  • Install the Panels Module
  • Create a empty fixed width panel to contain the node you want to load
  • Load the view into an adjacent panel

In your controlling view

  • Add a PHP view header and use (drupal_add_js('script.js')) to add a custom js file to the page. or add this to a custom module, or even your theme.
  • Re-Write your view node links to help put the js events together

Setup your javascript events

  • Use add_js to add a custom javascript js file to the page
  • In the custom js add an event to the view links that will poll the services module and load the node into the placeholder panel
0
votes

I've solved using the lightbox, and just removing the html code I don't need from the node template with php if the parameter "lightbox=true" is passed with the link.