Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Non-Clickable Links for il8N Navigation?
#5
(2013-05-25, 06:18:58)lnickel Wrote: So I take this code and make a component from it and call it it as a param in the get_nav function. Cool. Just dont know how to do the if/else

PHP code between <?php and ?>, HTML outside:
Code:
<li class="<?php echo $item->classes; ?>">
  <?php if ($item->hasChildren) { ?>
     <a href="<?php echo htmlspecialchars($item->link); ?>">
       <?php echo htmlspecialchars($item->text); ?>
     </a>
  <?php } else { ?>
     <?php echo htmlspecialchars($item->text); ?>
  <?php } ?>

  <?php if ($item->isOpen) { ?>
    <ul><?php $item->outputChildren(); ?></ul>
  <?php } ?>
</li>

You could of course also write the else-part simply as
Code:
<?php } else { echo htmlspecialchars($item->text); } ?>
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
RE: Non-Clickable Links for il8N Navigation? - by mvlcek - 2013-05-25, 06:31:47



Users browsing this thread: 2 Guest(s)