Welcome Guest, Not a member yet? Register   Sign In
Help with template header
#1

New to code igniter and would appreciate any advice.

I am trying to make the link in my header go to the pub_category_name instead of a list of the stores in the category.

Each category will only have one store/location to go to which is assigned in admin. So there will never be a need to display more than one for each category.

Here is the code from the header

              <li class="gnb"><a class="mn-stores" href="stores">Publications</a>
                  <div class="menu-contain-gift">
                      <ul>
                          <?php
                          foreach ($mainPublications->result() as $row){
                              if ($row->pub_name != ''){
                                  ?>
                                  <li><a href="stores/?pubid=<?php echo $row->id; ?>"><?php echo $row->pub_name;?></a>
                                  <?php if (in_array($row->id, $pub_root_id_arr)){?>
                                      <div class="submenu-contain">
                                          <ul>
                                              <?php
                                              foreach ($all_publication->result() as $row1){
                                                  if ($row1->pub_name != '' && $row->id==$row1->rootID){ ?>
                                              <li style="position: relative;"><a href="stores/?pubid=<?php echo $row1->id; ?>"><?php echo $row1->pub_name;?></a>
                                                  <?php }
                                              } ?>
                                          </ul>
                                      </div>
                                  <?php } ?>
                                  </li>
                              <?php }
                          } ?>
                      </ul>
Reply
#2

Please explain what's going wrong with your current code.
And what do you mean by "header"? A menu at the top of your website?
Reply
#3

Thanks for the reply

The code is not necessarily wrong but we just want to skip the page where it show the listing of store in the category.
It is set up so that each category is assigned only one store (it will never be more than one) and the same for sub category. Currently when you click on category or sub category it show the page where it lists the store in the category then you have to click on the store to view. This all works but we want to bypass the list page and make it so when you click on the category it goes directly to the store assigned that category.

Here is the link. Click on publication in top menu of the site. you will see 2 categories and sub categories
Reply
Reply




Theme © iAndrew 2016 - Forum software by © MyBB