Jump to content

echo outputs 2 times


rjgamer
 Share

Recommended Posts

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!

image.png.524e02a0a906b97e7331a9f7dac51b9b.png

 

image.png.7def845fe2b920ad46ee87d6a1b83928.png

image.png

Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...