Forum
perch_pages_navigation ignoring from-path
Hi,
I'm having a problem where perch_pages_navigation is ignoring the from-path specified. I've used similar code in my sidebar navigation which works perfectly, but I'm now trying to show section navigation in the footer of the website.
I have the following code in the footer layout of my page:
<!-- displays section heading -->
<?php perch_pages_navigation(array(
'from-path' => '/buying-from-inspired',
'from-level' => 1,
'include-parent' => true,
'template' => 'navigation_heading.html'
)); ?>
<!-- displays section navigation-->
<?php perch_pages_navigation(array(
'from-path' => '/buying-from-inspired',
'from-level' => 1,
'include-parent' => true,
'template' => 'navigation.html'
)); ?>
In my 'navigation_heading.html', I have the following code:
<perch:before><h5></perch:before>
<perch:pages id="pageNavText"/>
<perch:after></h5></perch:after>
And finally, in my 'navigation.html', I have this code:
<perch:before>
<ul>
</perch:before>
<li>
<a href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" /></a>
</li>
<perch:pages id="subitems" encode="false" />
<perch:after>
</ul>
</perch:after>
Yet in both the heading and the navigation items, they're including all other pages in the site (which at the moment is currently just the Contact page):
Does anyone have any idea where I'm going wrong?
If you turn debug on for the page, what does it output?
I'm getting the following output:
(Note: I now have navigation.html and navigation_subitems.html (for the main nav) and footer_navigation_heading.html and footer_navigation.html for the footer navigation. They're exactly the same other than the header nav has different html markup to allow for dropdown menus. They all still however, show the entire pages in the site for each nav heading and navigation items.)
Sorry for wasting your time Drew, completely my fault - I've just seen where I was going wrong! :(
I had from-path as "/buying-from-inspired" and I set the page up as "/buying-with-inspired" - Amateur moment!