hi, shahz -
just came here to ask about this code as well.
i think what's happening is that this line:
Code:
switch (isset($_GET['content']))
is evaluating to "true" (because isset() returns a boolean)... and then perhaps after that _any_ non-null value of $_GET['content'] will be cast to "true" and trigger the case.
seems to me that the switch condition should instead be
Code:
switch ($_GET['content']) // because we want to switch based on the content!
however this results in errors where "content" is not set, so it all needs to be wrapped in an "if" statement that evaluates isset().
(SPOILER ALERT):
Code:
<?php
if (isset($_GET['content'])):
switch ($_GET['content']):
case 'gents':
case 'sporting':
case 'women':
include 'content/catnav.php';
endswitch;
endif;
?>
works as expected:
- subnav links present on category pages for Gents, Sporting, Women
- subnav links not present on home, about, categories pages