franciccio-ITALIANO Posted August 24, 2020 Share Posted August 24, 2020 Hello, I created several templates. I apply them and I see them all in my site in local laragon, but one is not. I do not understand why. Processwire sends me the following error message. How can I correct it? Link to comment Share on other sites More sharing options...
MoritzLost Posted August 24, 2020 Share Posted August 24, 2020 Not sure what the problem is here, the error tells you exactly what's going on ? You appear to have a namespace statement somewhere inside your template – as per the documentation, namespaces need to be defined at the very start of your script. Either remove the namespace statement or move it to the top and the error will go away. If the namespace statement is at the very top and you're still getting the error, it might have something to do with (a) a problematic file encoding, make sure you're using utf-8 or (b) something going wrong with ProcessWire's template compiler. If correcting the problem does not make the error go away, please post your template so we can check what's going on. Link to comment Share on other sites More sharing options...
franciccio-ITALIANO Posted August 24, 2020 Author Share Posted August 24, 2020 Ok, I cheked but I don't find any errore namespaces... boh This is my template-file: ArticoloMINI-POLIS.php Link to comment Share on other sites More sharing options...
zoeck Posted August 24, 2020 Share Posted August 24, 2020 4 minutes ago, franciccio-ITALIANO said: Ok, I cheked but I don't find any errore namespaces... boh This is my template-file: ArticoloMINI-POLIS.php 26.72 kB · 2 downloads Line 437: <?php namespace ProcessWire; $content = $page->body;?> Just delete the "namespace ProcessWire" ? 1 Link to comment Share on other sites More sharing options...
franciccio-ITALIANO Posted August 25, 2020 Author Share Posted August 25, 2020 18 hours ago, zoeck said: Line 437: <?php namespace ProcessWire; $content = $page->body;?> Just delete the "namespace ProcessWire" ? Ok, so, I must write <?php $content = $page->body;?> or <?php echo $content = $page->body;?> Link to comment Share on other sites More sharing options...
zoeck Posted August 25, 2020 Share Posted August 25, 2020 3 minutes ago, franciccio-ITALIANO said: Ok, so, I must write <?php $content = $page->body;?> or <?php echo $content = $page->body;?> Just write <?php echo $page->body; ?> or the short code ? <?=$page->body?> Link to comment Share on other sites More sharing options...
franciccio-ITALIANO Posted August 26, 2020 Author Share Posted August 26, 2020 On 8/25/2020 at 9:51 AM, zoeck said: Just write <?php echo $page->body; ?> or the short code ? <?=$page->body?> ok perfect, thank you very much! :D 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