Links between Multilevel Dynamic Templates and other coded Templates
Hey all,
I am working on a theme that uses both a Multilevel Dynamic Template and several other coded templates, and I'm wondering how/what the best way to link between them would be. For example:
Pages A, B, C and D are all made using a multilevel dynamic template and nested within each other, starting with A as the highest level and working downwords.
I have another page made with another template, lets call this Page 1. Page 1 needs to have a links on it to pages A, B and C.
Since Pages A, B and C are all made using a multilevel dynamic template, I am unsure how to create these links to them without hardcoding the value into my theme.
Links between Multilevel Dynamic Templates and other coded Templates
So, here is the first set of pages - https://www.thesuccessfulbookkeeper.com/tsbk-lms . This is build using a multi level dynamic template. If you select "Begin Course" on Course 1, you can go through each of these nested pages just fine.
Then there's the dashboard page - https://www.thesuccessfulbookkeeper.com/dashboard This is currently using it's own theme page. If you look on the dashboard page there are several shared links, such as the begin course buttons. These buttons currenlty do not link from one theme page to the other however (from dashboard to tsbk-lms)
Jun 23, 20209:40 AM - edited Jun 23, 202012:39 PM
Key Advisor | Partner
Links between Multilevel Dynamic Templates and other coded Templates
@DavidFJones I'm not too experienced with the multi level dynamic pages but you could always use the standard HubSpot navigation menu for that. Would be better than hard coding into the template files since that's at least user facing / editable.
Links between Multilevel Dynamic Templates and other coded Templates
So I went in and added a simple menu with the intent that the user would add a single link to this menu. This link would go to the multilevel template.
From here the plan is to use js to grab this url and append that to all the links on the page that need to go somewhere within that multilevel template.
Could there be any unforeseen circumstances with this method?
You can anticiapte these URLs with 100% accuracy. When creating the tables URLs are defined with the "PAGE PATH" in the example:
So your root URL is page1.com, for example. To reference "Food" you would append the path "/food". The URL would be page1.com/food
And an identical structure for level B:
To get to apple you'd append the "/apple" path to the existing URL: page1.com/food/apple
The child paths are defined identically, so you can just keep adding the the "/ *path*" to get to the correct level from anywhere.
You case sounds very complex strickly due to the number of pages and not necessarily thr technology to create it. When we buil;d something like this we always build a journey map or a spreadsheet that shows all the parent child relationship of our content:
Page1
A
A.1
A.2
B
B.1
C
Page2
D
E
With one of these visuals you can see exactly what your URL structure will need to be.
TL;DR
Not sure how you planned to use JS to append URLs, but it shouldn't be necessary if they're being coded. Visualize your page structure so you can see whats where when authoring. To insert these without hard coding just create a custom module that would allow a user to select a path via drop down or manual entry.
I hope this helps! Obvisouly I'll be around to help if needed.
So since the domain is the same, and the multilevel template is able to grab the unique slug for the end of the url, the only problem area was that "tsbk-lms". So if we change this to something like "course", and then just require the user to make sure that the courses page has a slug of course, we can hard code that one value in and it will always pull up everything else correctly.