Hi Everyone
I am using the following code to display my menu (which works great), and have added additional functionality which is not working correctly.
Original code:
<ul>
<?php foreach ($categoryRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>
<?php if ($categoryRecord['_isSelected']): ?>
<b><a href="<?php echo $categoryRecord['url'] ?>" rel="self"><?php echo $categoryRecord['name'] ?></a></b>
<?php else: ?>
<a href="<?php echo $categoryRecord['url'] ?>" rel="self"><?php echo $categoryRecord['name'] ?></a>
<?php endif; ?>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach; ?>
</ul>
I added a new checkbox field labelled
open_in_new_page
which basically identifies the menu entry as a URL that needs to be opened in a new tab/page. Here is the new code:
<ul>
<?php foreach ($categoryRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>
<?php if ($categoryRecord['_isSelected'] && $categoryRecord['open_in_new_page'] == "0"): ?>
<b><a href="<?php echo $categoryRecord['url'] ?>" rel="self"><?php echo $categoryRecord['name'] ?></a></b>
<?php else: ?>
<a href="<?php echo $categoryRecord['url'] ?>" rel="self" target="_blank"><?php echo $categoryRecord['name'] ?></a>
<?php endif; ?>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach; ?>
</ul>
Unfortunately, all selected menu items open in a new tab/window!
Any help to solve this issue would be appreciated!
Ragi
--
northernpenguin
Northern Penguin Technologies
"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke