BUCKHORN Posted April 7, 2014 Share Posted April 7, 2014 I'm not sure why I can't get render() to work. The include works so I know the path is correct. Any ideas? //assign page $page = $pages->get('name|domain_alias='.$host); //redirect to 404 if we can't find a website that matches the host if(empty($page)) { print '<h1>Page Not Found</h1>'; } //render child pages foreach($page->children as $child) { include ($config->paths->templates.$page->theme[0]->name.'/'.$child->template.'.php'); $child->render($config->paths->templates.$page->theme[0]->name.'/'.$child->template.'.php'); } Link to comment Share on other sites More sharing options...
kongondo Posted April 7, 2014 Share Posted April 7, 2014 Quick one as I gotta run...$page? collision? That is a known property in PW....Just guessing ..... 1 Link to comment Share on other sites More sharing options...
BUCKHORN Posted April 7, 2014 Author Share Posted April 7, 2014 Do you think this is the problem? //assign page $page = $pages->get('name|domain_alias='.$host); I need to be able to completely overwrite the old $page with one I've selected. Link to comment Share on other sites More sharing options...
Soma Posted April 7, 2014 Share Posted April 7, 2014 You don't need to overwrite $page. And the 404 is usually: throw new Wire404Exception(); And how about echo $child->render(...); ?. PW never does echo something. Link to comment Share on other sites More sharing options...
BUCKHORN Posted April 8, 2014 Author Share Posted April 8, 2014 Thank you both for the help. Soma, I was going to have to hunt this down, I couldn't remember how it was done. Thanks. I tried render w/o the custom template path and still nothing. No error, just white screen. I don't even get an error when I remove the template. I echoed $child->title and it's populated so I do have child pages. Link to comment Share on other sites More sharing options...
BUCKHORN Posted April 8, 2014 Author Share Posted April 8, 2014 Oh wait, could this be an access/permissions issue? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now