I noticed that if there is more than one component using
@portal(pageStart, includeOnce: true)
that a newline character is sometimes (not always) being added at the end of each one. This looks neater in the page source but is breaking the HTTP header which may stop sessions and cookies working.
I have been careful to ensure I place the opening PHP tag immediately after the @portal and the closing PHP tag before the @endportal. It seems that Elements is sometimes (not always) adding the new line between one components closing tag and the next components opening tag.
<?php
code here
?> // Newline seems to be added here
<?php
code here
?>
I made some more tests and found a pattern. If I have two or more components that use
@portal(pageStart, includeOnce: true)
with includeOnce set to true then I see the new line after the component. If I change the includeOnce on one of the components to false then the new line disappears. I hope that provdes a clue!
A connected issue happens in the ‘Edit Extra Code’ dialog for the page. If I type a single line of code in the Page Start section like this
and in the published page the path is being sent as
../../../../../
instead of
../../
Any idea what could cause that. Maybe I am using rw.page.docRootPath incorrectly? It seems to work fine on my tests here though. We are both using the latest Elements from Yesterday.
It is odd as the path seems to work ok for me too when I try didn’t folder levels. I am doing a full publish to my local folders rather than FTP that Bart is using but I don’t see why that would make any difference.
Here is a download link for his project. He tried to send it via the Elements Cloud but ‘I don’t know why, but since the latest build I can upload project to Elements Cloud, but they disappear in the list and I can’t copy a link’
I did some tests with Bart’s project here and when I export it is using the incorrect path of ../../../../../
I added a console.log to my component and it is showing the same ../../../../../ in Elements editor too. On my own projects it is always correct no matter if its one or two folder levels down.
In my componnent I have this at the top of hooks.js. Maybe I have something missing causing rw.page.docRootPath to be messed up?