Closed Ices-Eyes closed 7 years ago
Hi Luca,
I think using TemplateTags.getPostLink( post.id )
in your about-page.html template and adding the following condition:
if ( current_screen.screen_type === 'single' && current_screen.data.post.post_type === 'page' ) {
template = 'page';
}
in your App.filter( 'template' )
filter should work ?
Thanks! It work perfectly :)
Great! Thanks for the very clear and well detailed question, have fun building your app :)
Hi. In my app I have a custom about page, that should link inside some different pages from the wordpress blog. I'm unable to achive this tasks. The only thing I can manage is to make the links and open them with the single template, but not with the page one. I try to explain what I've done. In the WP control panel I add a new component with slug=about-page and type=post list (tryed also with WordPress Page, but the result is even worst) In a php file I defined this:
On the functions.js in the app I defined this
And defined an about-page.html file that among other things in the end has this:
Now, if I use the TemplateTags.getPageLink the links are in the form of #page/about-page/29896 but when clicked just send me the main screen of the app. If I use TemplateTags.getPostLink( post.id ) the links are in the form of #single/posts/29896 and once clicked bring me to a single page, that has wrong formatting for pages.
What I would like to obtain is to open those links with the page template and with the back button on top left corner, to go back to the about-page, and not with the menu button like they were first level pages.
Is this achievable? I'm doing something wrong or am I in a complete wrong way?
Thanks, Luca