Forum
Blog and standard perch procedures like perch_pages_breadcrumbs()
Hi Perch,
Is there a special way to call procedures like perch_pages_title(); or perch_pages_breadcrumbs(); from my blog/index.php or my post.php? Currently it isn't displaying anything at all and I can't figure out why - it's ok on my other pages - though I do have a similar problem on some pages in the events app.
Thanks
Yes, there's nothing special about those pages - you should be able to call any page function from any page.
Hi Drew. Thanks for the response. I've narrowed down whats happening. It's nothing to do with apps.
No breadcrumbs are output.
Breadcrumbs appear nicely after the header as expected.
If I then remove the header, the breadcrumbs are still visible.
So - when I create a brand new page, unless I add a perch content before my breadcrumbs, I can't get them to appear. I think I'm getting the same behaviour with perch_pages_title();, but I need to test that one out again to make sure.
Am I not initialising something?
so - because my blog index doesn't call any perch_content, and just calls perch blog functions to list out posts, the breadcrumbs aren't being displayed. But if I add in any old perch_content call anywhere in the code, and give it a type via the admin, then the breadcrumbs display. The thing is, I don't want any perch_content calls in my blog/index.php page....
You just need to add your blog page so it appears in the Pages list.
Click on Add New Page and then choose the "file already exists" option.
That's already all set up. My blog page is already in the Pages list setup with "file already exists". The only thing to prompt things to work is to add the perch_content and assign a template to that content.
Have you hidden the page from navigation or anything like that?
No. It's all just simply setup. I have Blog in the admin with nothing assigned to it as it's a link only.
If I then add the perch_content and assign a standard text template, I get a new additional blog page in the admin which can then be data filled, but then it all works.
Ah ha - sounds like the one you added didn't have the correct path.
It should be something like:
Great - thanks You're right - the path was wrong! It has fixed the blog index page.
So - how do I provide some sort of breadcrumb at the post.php/archive.php level (or the events level for the calendar), as I don't want to be creating dummy admin pages for those pages as they would be hidden?
Thanks again for all your help with this.
ok. I see I need to add specifics to post and event pages to handle them differently (as they're not added as a page).
I added the following to get the breadcrumbs on the blog posts:
Thanks again for all your help.
That should do it!
it's not as dynamic as I'd like it to be - but I'm working on it.