How to set up page logic for course platform?

I’m a bit confused about the page logic here, can anyone point me in the right direction?

  1. I have a grid that’s loading courses from the database
    Now when I press the ‘Go somewhere’ button

I want it to take me to `/watch/{course_id}’ just like for example Netflix does image

Q1: How do I give the course ID to the next page using the button?

  1. When on the /watch/{course_id} page I will show a sidebar with each individual lecture.
    Pressing a lecture should load the video in the right side of the page and set the URL to /watch/{course_id}/lectures/{lecture_id}image

Q2: How do I give the lecture ID variable to the contents of the page on the right (server side include? a partial?) and then rewrite the URL with it?

I’m struggling with the logic a bit, so far I think I need to use the NodeJS URL rewriting doc… but how do I piece it all together?

Thanks in advance!

Does this help with your first question?

With your second question is need to play around with it to know for sure, but I would look at the node based templating system with layouts, views and partials.

I think you’ve already mentioned this might be what you need.

@Philip_J Thank you so much! This is what I was looking for, just need to be pointed in the right direction. Didn’t find the state management component yet so I think this will solve mos of it as you said. Then I’ll try the server side includes and partials for the watch page!

Thank you thank you!

1 Like