Hello Community,
I'm glad I discovered processwire and there are no words to tell you, how amazed I am by now.
My first post is a question, as just reading wasn't enough to find a solution this time - just to mention my great first impressions by the community. So hello all.
Enough love for now, I'm stuck at a problem which I thought would be easy to solve - sitting here for a day now.
Before going in detail, maybe I am missing something out in general:
Is it possible to render a complete, specific page inside a template? With all the markup rendered just like an include + the content? In case it is, here are my details:
I want to include my footer on every template via the '_main.php', as the footer does not change.
The footer is a custom template with 4 textfields and a page ('/footer/'), as I want to fill in the content from the backend - there are no files prepended or appended on it.
The footer-page renders fine, I can access '/footer/', but how can I render this page in the '_main.php'? So that I can change the footer in the backend (in all languages) and it prints on all pages?
I tried the following:
_init.php:
$footer = $pages->get('id=1036'); // also get('/footer/') just to make sure - knowing now all this returns just the id
$ftvar = $pages->get('id=1036');
$footer = $ftvar->render(); // This crashes my mysql
$footer = $ftvar->children->render(); // Just tried everything I could find
$footer = $ftvar->render('partial=true') // Throws error with and without '' - just found it, seems to be wrong as render does not take arguments
$footer = wireRenderFile("/footer/"); // Understanding it now
_main.php:
echo $footer;
And quite much other variations and possible solutions I can't remember anymore.
I learned a lot about what the API can get out of templates and specific fields - but my problem remains. I hope somebody can clear some things up for me as I just started with pw.
Thanks for your time!