adrianmak Posted January 15, 2016 Share Posted January 15, 2016 products-index.php <?php // debug message $content = "debug msg: This is a product index page."; $page_title = $page->title; $childpages = $page->children(); $layout = wireRenderFile("products-index-tpl", array('childpages'=>$products)); // output $content .= $layout; products-index-tpl.php <?php $out = ""; foreach($products as $product) { $out .= $product->title . "<br/>"; } echo $out; I found that $products is null/empty in products-index.tpl.php. Then, I print the $childpages at products-index.php, the variable has a value, pages id(s) If I didn't the wireRenderFile method and put back the foreach loop from products-index-tpl.php into products-index.php. IT WORKS. Link to comment Share on other sites More sharing options...
maniqui Posted January 15, 2016 Share Posted January 15, 2016 Try $layout = wireRenderFile("products-index-tpl", array('products'=>$childpages)); 2 Link to comment Share on other sites More sharing options...
adrianmak Posted January 15, 2016 Author Share Posted January 15, 2016 I see....I see I misplaced the source and target 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