Skip to main content
May 16, 2007
Question

Current menu bar in list and detail page

  • May 16, 2007
  • 1 reply
  • 235 views
I have created two pages, one that shows a list and the other that shows the details. On the list page I have placed a navigation that is from the database. I was able to show my selection as current through CSS. However, when I click on details for my details.php page my selection from my menu is not selected.

I have made a php include within both pages.

For both list.php and details.php I have placed a record set for the navigation as follows...
SELECT *
FROM jobtype
WHERE online = 1
ORDER BY jobOrder ASC

For the list.php record set is as follows...
SELECT jobID, jobTitle, jobDescrip, jobDownload, online
FROM job
WHERE online = 1 AND job.jobTypeID = 'jobType'
ORDER BY jobTitle ASC

Variables
Name = jobType
Default Value = -1
Run-Time Value = $_GET['jobTypeID']

For my include regSideJob.php is as follows...
<?php if ($totalRows_rsJobTypes > 0) { // Show if recordset not empty ?>
<ul>
<?php do { ?>
<li <?php if($_GET['jobTypeID'] == $row_rsJobTypes['jobTypeID']){?>class="current" id="current"<?php } ?>><a href="index.php?jobTypeID=<?php echo $row_rsJobTypes['jobTypeID']; ?>" ><?php echo $row_rsJobTypes['jobName']; ?></a></li>
<?php } while ($row_rsJobTypes = mysql_fetch_assoc($rsJobTypes)); ?>
</ul>
<?php } // Show if recordset not empty ?>


I am stuck because when viewing in details.php my current is not highlighted as if I were to view it in the list.php page.


This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

May 17, 2007
Does any body have a clue?