Custom View of Lessons (Grouped)

Tim Sparrow
Forums
Hi Opigno Team, I am trying to create a custom view of a course where it shows lessons and questions. So far, I can display a list of the lessons and the underlying questions (with links to 'take' the lesson): What I want to get to is this: [Course] [Lesson 1] [Q1] [Q2] [Q3] etc ... [Lesson 2] [Q1] [Q2] [Q3] etc ... [Lesson 3] etc... [Course] links to a specific lesson (Lesson ALL) containing all the questions for the course. [Lesson X] links to the specific lesson X (take). Each Lesson imports it's topic questions from Lesson ALL [QX] links to the specific question (take). Naming convention is [Course]-[Lesson X]-[QX] As mentioned, I can get the view to display [Lesson X] (unlinked) and [QX] (linked correctly to 'take'), but cannot work out how to display the [Course] level of hierarchy in the same view. These are the fields I currently have in the view: Content: Title Content: Chapter Name (Custom field containing lesson title I added to [Lesson]) Content: Path Content: Question Output is as follows: [Lesson 1] [Q1] [Q2] [Q3] etc ... [Lesson 2] [Q1] [Q2] [Q3] etc ... [Lesson 3] etc... Is it possible to group together in the way I described in a single view? I have thought of re-writing outputs and hard-coding the 'take' URL but that sort of breaks the benefit of using a view over a custom page. Any guidance greatly appreciated :) Many thanks, Tim
Profile picture for user James Aparicio
James Aparicio

Hi Tim,

Hi Tim,

If you already have the level for a specific course, on that view, you use the course id as a contextual filter.

Then you create a new view that lists the courses, and add a field that is the view you already have.

You can use this module. For the urls there is the option to replace the link inside the views.

https://www.drupal.org/project/views_field_view

 

 Best regards

Tim Sparrow

Thanks James. I actually

Thanks James. I actually just finished implementing a workaround. I added 3 fields to [Slide] which allowed me to provide the 2 levels of hierarchy and node link back to the parent for a custom view menu. A dirty fix, but it does the job intended. Longer term, I will look to try the method above, but for now, other priorities are calling :)