Category Menu - need to generate unique link
2 posts by 2 authors in: Forums > CMS Builder
Last Post: June 30, 2015 (RSS)
By meg - June 28, 2015
I built a category menu in the CMS to use as my main menu. The categories and sub-categories display properly. However, the links it generates are www.domain.com?breadcrumb. I set up a specific form field in the category menu to take unique links, entitled "link." How can I get the menu to generate the link from that form field instead of the domainname.com?breadcrumb ?
Code I'm using now:
<ul>
<?php foreach ($main_menuRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>
<?php if ($categoryRecord['_isSelected']): ?>
<li><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
<?php else: ?>
<li><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></li>
<?php endif; ?>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach; ?>
</ul>
By Dave - June 30, 2015
HI Meg,
Can you just output the value of the link field? eg: <a href="<?php echo $categoryRecord['link'] ?>"> (no underscore)?
Let me know if that works for you. Also, if you use the Code Generator to create a "List View" viewer for the category section it should output the PHP code to display every field you have so you can easily copy and paste the tags you want.
Hope that helps!
interactivetools.com