# pageStart Portal issue

**URL:** <https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029>\
**Category:** Elements API\
**Created:** [June 12, 2025, 11:02am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029 "2025-06-12T11:02:11Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![vibralogix](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/vibralogix/32/3065_2.png) [@vibralogix](https://forums.realmacsoftware.com/u/vibralogix)\
**Post date:** [June 12, 2025, 11:02am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/1 "2025-06-12T11:02:11Z")

</div>

I noticed that if there is more than one component using

```auto
@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.

```auto
<?php
code here
?> // Newline seems to be added here
<?php
code here
?>

```

---

<div class="post-metadata">

**Author:** ![ben](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ben/32/28488_2.png) [@ben](https://forums.realmacsoftware.com/u/ben)\
**Post date:** [June 13, 2025, 6:48am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/2 "2025-06-13T06:48:48Z")

</div>

I’ll add a ticket to investigate this, but if you could provide a full code example with expected output, that’d be a big help 🙏

---

<div class="post-metadata">

**Author:** ![vibralogix](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/vibralogix/32/3065_2.png) [@vibralogix](https://forums.realmacsoftware.com/u/vibralogix)\
**Post date:** [June 14, 2025, 9:23am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/3 "2025-06-14T09:23:15Z")

</div>

I made some more tests and found a pattern. If I have two or more components that use

```auto
@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

 ![Capto_Capture 2025-06-14_10-19-37_AM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/8/b/8bc8c29fb2bbc45ca53506a067b12f2135d2086e.png)

then that seems to have a newline at the end of it when the page is published.

---

<div class="post-metadata">

**Author:** ![ben](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ben/32/28488_2.png) [@ben](https://forums.realmacsoftware.com/u/ben)\
**Post date:** [June 16, 2025, 7:30am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/4 "2025-06-16T07:30:21Z")

</div>

I’ve ticketed this one for us to investigate 🙂

---

<div class="post-metadata">

**Author:** ![tpbradley](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/tpbradley/32/25503_2.png) [@tpbradley](https://forums.realmacsoftware.com/u/tpbradley)\
**Post date:** [July 8, 2025, 3:49pm UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/5 "2025-07-08T15:49:59Z")

</div>

Hey @vibralogix, the first issue with new lines in @portal statements should be fixed in [today’s release, version 1.0](https://forums.realmacsoftware.com/t/elements-1-0-23688/48669)!

I have a fix for the second issue too, new lines in the page code area. This should be going out in the next release due in the next few days.

Cheers

---

<div class="post-metadata">

**Author:** ![vibralogix](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/vibralogix/32/3065_2.png) [@vibralogix](https://forums.realmacsoftware.com/u/vibralogix)\
**Post date:** [July 8, 2025, 4:32pm UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/6 "2025-07-08T16:32:03Z")

</div>

Hi Tom,

That’s fantastic. Wow V1.0 😀

Cheers for that.

---

<div class="post-metadata">

**Author:** ![vibralogix](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/vibralogix/32/3065_2.png) [@vibralogix](https://forums.realmacsoftware.com/u/vibralogix)\
**Post date:** [July 9, 2025, 12:15pm UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/7 "2025-07-09T12:15:13Z")

</div>

Hi Ben,

I just heard from Bart and it seems there may still be an issue with the rw.page.docRootPath.

He published a page with the folder set like this

 ![c86967d4-3d8d-48c5-8444-83bc0512d80d-spark-clipboard.png](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/9/d/9dc5dc2221d88bbe6f990d4f8204b528fd716e1c.png)

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.

---

<div class="post-metadata">

**Author:** ![tpbradley](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/tpbradley/32/25503_2.png) [@tpbradley](https://forums.realmacsoftware.com/u/tpbradley)\
**Post date:** [July 9, 2025, 6:58pm UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/8 "2025-07-09T18:58:42Z")

</div>

Oh that’s strange! I’m having trouble reproducing that here, any chance you could send over a project that reproduces the issue?

---

<div class="post-metadata">

**Author:** ![vibralogix](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/vibralogix/32/3065_2.png) [@vibralogix](https://forums.realmacsoftware.com/u/vibralogix)\
**Post date:** [July 10, 2025, 9:14am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/9 "2025-07-10T09:14:43Z")

</div>

Hi Ben,

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_’

[https://www.dropbox.com/scl/fi/9hmoruau7rnckzg3u6nce/BAOW-25-26.\_2.0\_elements.elements.zip?rlkey=3ivi1m4kcjh9h34whcyqmkku0&dl=1](https://u2110053.ct.sendgrid.net/ls/click?upn=u001.iwtrMqUXM1wmMEttnmQDIVumo40fkbh5NMLcUYvSts3bPNxk3u83xI7bHWbuljBvd8EDqu2Ki-2BH1jlcVDlwsSxH5UHzUj9Xntt3hdBBg9kPJJR2BJrjMboi1elsT95yWb7GAn30y3GYvjK7pbeH9W3JZSi3A89rubFxAWP0t4dSYbXjL6M9XC4EUWJGoaaUPCzuD_4pshOuBcnCe-2BT469u2X2w-2Bs2UoAoqCmvRZ8f19DsWXWoo-2BbPgG9W1GrBRPRKHeqPMqobrLCoXyAKN5D-2FaUNmsW7ZmsWJTpxEtungcFldwAVvFdY2uTBeC4bKNlfvwvFQaSOvmQzav36srUYKGp-2FQYiH-2FbsT09KrGDSqqOekoowDX-2FgM4nD2w0cMdc9y-2BBib3Evj-2FkT-2F1B7H1eSdc20l4Qp30VrIV6-2BIR1wurQlOjkuAcC6NWEd14M-2FYEon2VbtpzqqSpccWDRFInk7o2vaAEaw-3D-3D)

An example problem page is in Bestuur - Pro League - JPL\_01\_inschrijvingen

 ![Capto_Capture 2025-07-10_10-11-31_am.png](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/7/7/7776a8486d4469f2ad5ff3a01ba85079452a0cc9.png)

Maybe I am not using rw.page.docRootPath correctly?

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [July 10, 2025, 9:18am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/10 "2025-07-10T09:18:00Z")

</div>

> [@vibralogix](#):
>
> 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’m wondering if you’re out of cloud storage as we haven’t coded a warning to alert the user about this yet 😬

Can you check your cloud storage in the preferences, it’s under: Settings \> Account and displayed in the bottom right hand corner…

---

<div class="post-metadata">

**Author:** ![vibralogix](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/vibralogix/32/3065_2.png) [@vibralogix](https://forums.realmacsoftware.com/u/vibralogix)\
**Post date:** [July 10, 2025, 10:23am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/11 "2025-07-10T10:23:39Z")

</div>

I will double check with him about that. Let me know when you have the file downloaded from Dropbox.

---

<div class="post-metadata">

**Author:** ![vibralogix](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/vibralogix/32/3065_2.png) [@vibralogix](https://forums.realmacsoftware.com/u/vibralogix)\
**Post date:** [July 10, 2025, 4:13pm UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/12 "2025-07-10T16:13:15Z")

</div>

Hi Tom,

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?

```auto
const transformHook = (rw) => {
  const {
    slMembersOnly,
    slRegisterForm,
    slUpdateForm,
    slLoginRedirectForm,
    slLoginForm,
    slContactForm,
    slWhoHasAccess,
    slUsergroups,
    slUsernames,
    slAllowPublic,
    slAllowExpired,
    slCustomPath,
    slForceDBRead,
    slblabMemberProfilepage

  } = rw.props;
  console.log(rw.page.docRootPath);

```

---

<div class="post-metadata">

**Author:** ![vibralogix](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/vibralogix/32/3065_2.png) [@vibralogix](https://forums.realmacsoftware.com/u/vibralogix)\
**Post date:** [July 15, 2025, 7:09am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/13 "2025-07-15T07:09:27Z")

</div>

Hi @tpbradley,

Just wondered if you had a chance to look at the odd paths in the project when publishing?

Thanks Adrian

---

<div class="post-metadata">

**Author:** ![tpbradley](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/tpbradley/32/25503_2.png) [@tpbradley](https://forums.realmacsoftware.com/u/tpbradley)\
**Post date:** [July 15, 2025, 8:18am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/14 "2025-07-15T08:18:41Z")

</div>

Sorry @vibralogix,

I was sidetracked with the recent Elements and Classic releases. I have the sample project from Dropbox and will take a look at this today!

Cheers

---

<div class="post-metadata">

**Author:** ![vibralogix](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/vibralogix/32/3065_2.png) [@vibralogix](https://forums.realmacsoftware.com/u/vibralogix)\
**Post date:** [July 15, 2025, 8:49am UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/15 "2025-07-15T08:49:41Z")

</div>

No problem I know you have been busy these days

---

<div class="post-metadata">

**Author:** ![tpbradley](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/tpbradley/32/25503_2.png) [@tpbradley](https://forums.realmacsoftware.com/u/tpbradley)\
**Post date:** [July 17, 2025, 2:16pm UTC](https://forums.realmacsoftware.com/t/pagestart-portal-issue/48029/16 "2025-07-17T14:16:52Z")

</div>

@vibralogix The sample project was most helpful! I was able to recreate and fix the issue in [Elements 1.0.6 (23722)](https://forums.realmacsoftware.com/t/elements-1-0-6-23722/48916) so please give it another try.

Cheers
