Hi everyone,
I'm new to processwire and I'm trying to figure some things out. I really like the idea of markup regions but everytime I end up with some double executed PHP scripts.
This is in my config.php
$config->useMarkupRegions = true;
$config->appendTemplateFile = '_main.php';
This is the markup element in my _main.php
<div id="page-content">
<!-- Fill content -->
</div>
This my overview.php template
<?= 'test' ?>
<div id="page-content">
<h1><?=$page->title?></h1>
Overview page
</div>
If I add some php code to the _main.php or overview.php template, it will be executed twice. For example, like in overview.php, when I echo 'test' at the top of this file, it will output testtest at the top of my page (I added a screenshot). However, the page title will only display once. I also had this problem in my _func.php file. I do not really understand where I have to include my _func.php file now, while using markup regions. In the config or main? Or somewhere else? Can anyone help me into the right direction? Thanks!