Forum
Breadcrumbs In Microsite
I am using breadcrumbs as <?php perch_pages_breadcrumbs(array('template' => 'breadcrumbs.html')); ?>
I have a subdirectory I want to treat as a microsite. The path is for example myurl.com/photography/google/page1/page2
However say user is on page2 I want the breadcrumbs to show: google > page1 > page2
Currently they show photography > google > page1 > page2
Below is my breadcrumbs code
<perch:before>
<div class="l-submain no-padding-bottom">
<div class="g-breadcrumbs">
<div class="l-submain-h g-html i-cf">
</perch:before>
<span class="g-breadcrumbs-item">
<perch:if exists="perch_item_last">
<span class="g-breadcrumbs-item"><perch:pages id="pageNavText" /></span>
<perch:else />
<a href="<perch:pages id="pagePath" />" class="g-breadcrumbs-item"><perch:pages id="pageNavText" /></a><span class="g-breadcrumbs-separator">»</span>
</perch:if>
</span>
<perch:after>
</div>
</div>
</div>
</perch:after>
You'd need to create a navigation group for your microsite and use that for the breadcrumbs.
Okay I found the documentation, say I have already created pages:
Brilliant, thanks!
Do you know if there is a way to rename the starting link in a breadcrumb?
My problem is for management purposes in the Admin area, the "Home" page is called Adwords or Bing so I can easily identify it.
However whatever the page is called dictates the name of the link like: Adwords » Services » Test
Ideally I would like that to display as Home. Is this something to change in the breadcrumbs template, if so how? Or is there a way to have the Admin window use a name that is not the one that appears in the front end navigation?
Yes, you use
perch:if
to test for it and output an alternative.Sorry to be so dense in my code its outputting correctly the path, but I dont want the root path to be called "Adwords" but "Home"
The only way I have managed that is to rename the page "Home" but then it will be hard to pick out in admin.
So is there a way to edit below to do this?
If the page is called 'Adwords' output 'Home' else output the page name.
So I did all this, sort of works. However I am not sure what is the problem, currently running 2.8.15.
When I reorder the Navigation Groups, the breadcrumbs completely disappear. I cannot get them back unless I delete the Navigation group and recreate.
Is this a bug or an issue with my install?
It seems to only work if I create the Navigation group in the correct order of page flow from creation.
That's not a supported version of Perch. The only version of Perch 2 we still support is 2.8.34.
Well I updated to 2.8.34 and the problem is still there.
This is my diagnostics:
How are you adding the items to the group?
By selecting the checkbox in page options called Navigation groups. I added them in the order they flow and it turns out reversed, so going into the Navigation Group and reordering pages stops breadcrumbs displaying at all. Even just saving while in the reordering state without moving them around screws it up.
Is this some kind of permissions or database issue?
This is code in breadcrumbs:
This is code on page:
Can you show me the debug output from there page where the navigation isn't working?
Its below, however I think personally something is going on with the database?
I checked the mysql database and changing the order or saving in the Navigation group definitely doing something to the database. It screws the following columns in "perch2 navigation_pages":
pageOrder pageDepth pageTreePosition
I can get it working by editing in the database using a screenshot of when it worked. I had to flush the navigation tables to get it working again.
When you say screws, what change are you seeing?
It changes the numbers in these columns:
pageOrder pageDepth pageTreePosition
They then do not work.
I have found another way to achieve the breadcrumbs that seems to work, I have set the parent directory to hidden (its only a link) from navigation then:
<?php perch_pages_breadcrumbs(array('template' => 'breadcrumbs-adwords.html', 'include-hidden' => false)); ?>
and inside my main directory:
<?php perch_pages_breadcrumbs(array('template' => 'breadcrumbs-photography.html', 'include-hidden' => true)); ?>