Search the Community
Showing results for tags 'template files'.
-
I am just creating my very first template files and have been unable to resolve the following problem. It says the '=' sign is unexpected but I have other templates files where identical code works OK. Is there something I'm missing? I have just included the 2 lines of code involved. Any help would be appreciated. Line 64 $ground-equipment = $page->children(); Line 65 foreach($ground-equipment as $ground) Parse error: syntax error, unexpected '=' in /volume1/web/Testing-Ryan/site/templates/GroundEquipment_Display_Page.php on line 64
-
The recent introduction of the Markup Regions has caused some excitement in our community, mainly for the simplicity of the proposal to output our markup, but for the various opinions about how to select and modify the regions, maybe it should not be the definitive solution. Perhaps the most correct option is to think this output strategy in the "Processwire style". Something open and versatile. The solution could be: Have the layouts files (main.php) as our "Markup Database" and then with the templates files (home.php) we can do "CRUD operations" on it before the output, using for that a jquery/processwire like API. This could be a powerful way like the current excellent API solution to manipulate the data. Where $markup come from the layout file "_main.php", in our templates files we'll can do: <?php $markup->find('#sidebar').prepend(' ?> <div class="foobarcontainer"> <h3>Hello <?php echo $page->foo ?></h3> <p><?php echo $page->bar ?></p> </div> <?php '); ?> <?php if ($hidecomments) $markup->find('.comment').addclass('close'); ?> <?php $markup->find('#sidebar .contact ul').remove(); ?> Etc. Think about the possibilities, it will no longer be necessary to define regions, the regions are any part of the document It's just an idea, maybe is a really hard to-do solution, but will be perfect for the Processwire ecosystem as the direct-delayed output workflow. In GitHub already are several php libraries for select DOM elements using any css selector in a jquery like style.