views:

42

answers:

2

In my drupal config I have created a video page, which I'm using to create video titles. I also created a course page, which will be displaying all the video titles available in that course using views and node reference combination. It only displays video title list.

Now, Take a look here http://www.lynda.com/home/DisplayCourse.aspx?lpk2=65713

You see the video titles are arranged in a chapter - wise manner, using javascript to hide/show chapter title.

I want to implement a similar functionality in my drupal site. If it is not possible with views thats ok, but I need a way to implement the javascript and chapter title in the course page. I want to keep the layout same as much as possible.

Even if I have to manually enter/edit the code in the body, I don't care as long as I have the functionality.

A: 

If you have implemented the markup, the javascript effect will be pretty easy to make.

You just need to apply a click handler on the chapters and hide/show the content. jQuery that is included in Drupal makes this quite simple and easy.

For the markup, it will probably be easier to do in a custom module, since you need a very specific ordering, and need some specific info on the chapter as well as the pages.

Update:
You should consider using node relationships, and use two content types. Especially if you want more info for each chapter like a image, teaser text etc.

googletorp
Chapter are not content type!! they are simple words. I have taken care of the ordering by implementing a invisible cck integer field and ordering them using sorting in views.
Nikhil
+1  A: 

If you don't want to write the jQuery and are satisfied with the "accordion" effect see http://drupal.org/project/views_accordion

A demo of views accordion can be found on http://manueg.okkernoot.net/ (See "latest thoughts" in the main content area). This is integrated with views so all you need do is to make the correct video title the accordion title.

You can probably theme the accordion too to get the desired user interface.

Sid NoParrots
This was really perfect !! though it was an accordion, it played well for me. But can you tell me how do I make all the accordion open initially, because thats what I really want.
Nikhil
@Nikhil: Try seeing what events cause the accordion to open up. You can probably issue the same events during $(document).ready() yourself. Maybe there are some options in the accordion module to open up all of them by default initially.
Sid NoParrots
No, it doesn't has a option already, I think I will have to hack into the code.Also is there is a way to display the content in the accordion inline. I have 4 fields, one is the header and rest I need to display as a row, way the original view does.
Nikhil