Alpine418 Posted January 17, 2023 Share Posted January 17, 2023 Hi, I've a simple echo output on the top of a template file. But ProcessWire outputs the echo 2 times. Does this mean the template file gets loaded 2 times? Or is there a misconfiguration on my side? I use markup regions as output strategy as you can seen with pw-id="content". Thanks for your support! Link to comment Share on other sites More sharing options...
virtualgadjo Posted January 17, 2023 Share Posted January 17, 2023 Hi, even without seing the whole code, the first thing that comes in mind is you echo is not inside any html tag the php block with the namespace is not really made for receiving any output except for testing reasons, have you tried erasing the echo here and putting it inside an html part below (inside your .card for example)? have a nice day Link to comment Share on other sites More sharing options...
Alpine418 Posted January 17, 2023 Author Share Posted January 17, 2023 Yes, when echoed in a HTML tags it got only outputted once. But if this is the case with markup regions, then the code out of html tags will be executed two times and does hurt the performance. Or not? Link to comment Share on other sites More sharing options...
virtualgadjo Posted January 17, 2023 Share Posted January 17, 2023 or not, affirmative ? actually, using markup regions, you have multiple choices to echo contents but markup regions or not, just remember that when you do things within the php tags before echoing any output, this happens even before the html tag (the _main.php file is included to the end of your template) usually, with markup region, this top php block is used to find pages, prepare some foreach and so on but don't worry, what happens inside the html tags below is only executed once, be it inside the main container you have in all your templates or in those "optional" blocks you can define with the pw attributes ? have a nice day 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