Creating a dynamic next button for detail page

Hi, am building a blog and the model consist of 14 stations. I see it as unprofessional to create a template for each of this station. Is there a way i can do so that in my template when i click next it goes to next station detail without creating a template for each of this stations? below are the logics.

this is my and you can see from the commented line how i try to implement it but it did work.

  def station_details(request, station_id):
      my_blog =My_blog.objects.all()
      slider = Slider.objects.all()
      prayers = Prayers.objects.all()
      stations_detail =Stationofcross.objects.get(title=station_id)
      stations = Stationofcross.objects.all()
      # next_station = Stationofcross.objects.filter(title=current_station.station_number + 1).first()
      # detail_button = + 1
      context = {
          # 'detail_button':detail_button,
      return render(request, 'blog/stations_detail.html', context)

this is the button in my template

  <a class="btn btn-secondary" href="{% url 'station_details' detail_button.title %}">Next</a>

this is the

  class Stationofcross(models.Model):
      title= models.CharField(max_length =100, null=True)
      date =models.DateTimeField('Date Created', auto_now_add=True)
      stationimages=models.ForeignKey('StationsImages', on_delete=models.CASCADE, null = True)
      letuspray=models.ForeignKey(Stationsprayers, on_delete=models.CASCADE, null = True)
      def __str__(self):
          return self.title

please help me know the better way to achieve this

You have to create a master template that takes the context for each Station, so each station will provide the context and that will be the dynamic content.

Are you making this for a stations of the cross? If that the case feel free to contact me I will happy help you.

Yes! Am am creating a station of the cross! It a Catholic blog. I have gotten the solution to the problem by creating an interger field to hold the number of each station. Thereby moving from one station to another within the same detail page. Mean while I will need your assistance alot if I can have your contact and should Incase you want to take a look at the project for advice or improvement I can forward it on GitHub. Thanks for your support!

Multi Steps HTML forms use one .html file. Download a free templates offline.

If you have data in multiple models or forms you need to use django_multistepform OR just just pass multiple forms in one view and have a context variable for all of them. All on one html file.