Navigation for 2 level outline

I’m creating an LMS (learning system) and I have 3 tables:

  • courses
  • sections
  • topics

Sections and Topics serve as an outline, such as:

Section 1

  • Topic 1
  • Topic 2
  • Topic 3
    Section 2
  • Topic 1
  • Topic 2
    Section 3
  • Topic 1
  • Topic 2
  • Topic 3

Each Topic has lesson content within each record. I’m able to generate the navigation using a repeating group within a repeating group. That works fine.

My question is, I want to create Next/Previous Topic buttons. As far I know, this requires indexing the entire list of topics. However, with my nested repeating groups, I don’t have an “overall” index for the topics.

I’m considering creating a Topic Index ID, such that it combines the Section and Topic index.
E.g.

  • Topic 1.1
  • Topic 1.2
  • Topic 1.3
  • Topic 2.1
  • Topic 2.2
  • Topic 3.1
  • Topic 3.2
  • Topic 3.3

But now I’m getting a bit lost how to “find” the previous/next topic, based on my what Topic page I’m on currently. I use URL parameters to pull up the Course+Topic.

So if I’m on Topic 2.1, I want to go up to Topic 1.3 or down to Topic 2.2.

Also, my repeating groups don’t generate the full outline at once. It only shows the Topics within the section I’m in, to save query load. So if I’m on Topic 2.1, the page hasn’t yet queried Section 1 to know there’s 3 sub-topics.

So:

  • how can I set up the page buttons to find what the previous and next topic in the outline is?
  • after it finds the neighboring topics, how do I redirect the page to that topic? (I think I can just load the topic ID into my URL parameter)

This topic was automatically closed after 70 days. New replies are no longer allowed.