Search the Community
Showing results for tags 'markup region'.
-
I use these Markup Regions and Bulma CSS Framework in _main.php: <section class="section"> <div class="container"> <div id="content1" class="content"></div> </div> </section> <section class="section"> <div class="container is-fluid"> <div id="content2"></div> </div> </section> <section class="section"> <div class="container"> <div id="content3" class="content"></div> </div> </section> I want to specify HTML tags required by a CSS framework - and it shall be output only when the Markup Region produces an output. I want the full SECTION to be hidden in case the region doesn't output - because if the SECTION tags are output then it will affect the layout in unintended ways. So my question is, how can I hide SECTION tags when the region doesn't produce an output? To me, the challenge here is that Bulma requires a layout structure before Content 1-3 are output (specifically, the SECTION and DIV.container tags) - and it seems this pattern is always output by Markup Regions - which is causing the mentioned issues. Feel free to suggest alternative ways to work with Markup Regions and Bulma (or other CSS frameworks).
-
I am trying Markup Regions for the first time on a site these days. And I have read Markup Regions Front-End Docs at ProcessWire.com. There is says that "pw-" and "data-pw-" is doing the same thing. Although I get different output when I try both in the same situation. E.g. when I am trying to append a <script>-tag, I need to add data-pw-append=footer. With just pw-append, it will output the script above <doctype> and <html>. Also, I need to use data-pw-append inside a php function, with pw-append the same as above happens. Other places, I cannot recall exactly where, the opposite happens. Where I have to use pw-append instead of data-pw-append. (Or pw-id instead of data-pw-id). Is this normal behavior? Is there any more documentation on usage I have missed perhaps?
-
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!