linking diffirent wepages

4 views
Skip to first unread message

Surya Adhikari

unread,
Jul 8, 2019, 3:51:35 PM7/8/19
to Django users
my nav menu have 2 menus : 
Home ,  Search Names 

ie. from index page when i click student from Sub menu of Search names  , it will redirects search.html after
if i click again teacher from search.html it will redirects to search.html/ search1.html rather then search1.html only.

it works normal only from index page. 
 i am inheriting the nav menu from index page to all of other pages. 
what am i doing wrong ? 

<div class="topnav">
   
  <a href="">Home</a>
 
  <div class="dropdown">
    <button class="dropbtn">Search Names 
      <i class="fa fa-caret-down"></i>
    </button>
    <div class="dropdown-content">
      <a href="search">student</a>
      <a href="search1">teachers</a>
      <a href="search2">non teaching</a>
     </div>

Chetan Ganji

unread,
Jul 10, 2019, 5:51:55 AM7/10/19
to django...@googlegroups.com
Because the href is relative to the current page. Use url tag of django templates. That will solve your problemo.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3bf58350-5f27-4b88-b803-1694ada2d6a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages