0

I'm busy making a documentation page in my Django project and would like to make a dynamic page where theres a sidenav with links but if you click on a nav item it loads the page within the "master page aka the documentation page" without leaving that page

like so https://www.nbinteract.com/tutorial/tutorial_github_setup.html

I have created the side nav etc and it's working fine and linked my first URL to a nav item but if you click on the nav item, it opens that .html file instead of loading it within the main documentation page.

I would like to find a way to do it with Django only and not JavaScript if possible, any guidance would be appreciated.

Yes, this could be a silly question but please don't flame me about learning how to do stuff :)

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153
Faziki
  • 767
  • 1
  • 9
  • 24
  • Don't think Django could do that without any use of Javascript. I guess what makes the website you quoted working is a bit of javascript. Angular is designed to do this (if I remember well), maybe check it out to see if it could fit your needs. – bastantoine Nov 17 '19 at 21:09
  • @BastienAntoine I'm wondering if you can use the {block content} in Django to update the page when nav item is clicked on doing some research on it as we speak – Faziki Nov 17 '19 at 21:12
  • no you couldn't, those tags are processed by Django's template processor on the server before you get the response. I invite to have a look at the [documentation](https://docs.djangoproject.com/en/2.2/topics/templates/) to know more. – bastantoine Nov 17 '19 at 21:28
  • @BastienAntoine I found this https://stackoverflow.com/questions/340888/navigation-in-django – Faziki Nov 17 '19 at 21:31

1 Answers1

0

The site you linked uses Javascript and you will need to use Javascript as well if you want to update only portions of the client-page with new data from the database.

David Alford
  • 2,044
  • 3
  • 12
  • 35