Forum
Displaying a page title from another page
I've got a blog installed. I've created an 'Intro' region on my main blog index and also changed the page title of the blog to 'Articles'.
On the blog post page I want to display the title from the index.... I can access the intro fine with:
<?php
perch_content_custom('Intro', array(
'page'=>'/blog/index.php'
));
?>
But how do I get the title?
ahhh
You've got it.
Is there any way to use page attributes with perch_content_custom?
Use in what respect?
I mean can I output the page title, description, or any other custom page attributes when using perch_content_custom? I've tried using perch_content_custom call and referencing perch:pages inside my template but that doesn't seem to work.
Maybe I'm confusing myself... Sorry if my questions seem dumb.. Its taking me a while to get my head around how perch works.
You'd need to pass them into the template.
https://docs.grabaperch.com/docs/templates/passing-variables-into-templates/
Tried passing in the
page
option and it didn't work, perhaps because the page the code was on did not exist in Perch. Checked out theperch_page_attribute
code and it appears that the page_id
is what needs to be passed in options if the current page is not in Perch.So it would be: