# Odd issue with portal headEnd

**URL:** <https://forums.realmacsoftware.com/t/odd-issue-with-portal-headend/47085>\
**Category:** Elements API\
**Created:** [April 9, 2025, 9:52am UTC](https://forums.realmacsoftware.com/t/odd-issue-with-portal-headend/47085 "2025-04-09T09:52:04Z")\
**Posts on this page:** 6\
**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:** [April 9, 2025, 9:52am UTC](https://forums.realmacsoftware.com/t/odd-issue-with-portal-headend/47085/1 "2025-04-09T09:52:04Z")

</div>

I am trying to add some code to the edn of the HEAD section. This normally works fine but when I do this its adding it to the BODY instead when published.

```auto
@portal(headEnd, includeOnce: true)
<?php if (function_exists('sl_registerformhead')) sl_registerformhead(152,false); ?>
@endportal

```

I know its unusual but it should be valid as the PHP is actually renderign the head code required when it is run.

Any ideas on how to solve that?

---

<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:** [April 9, 2025, 10:04am UTC](https://forums.realmacsoftware.com/t/odd-issue-with-portal-headend/47085/2 "2025-04-09T10:04:26Z")

</div>

Hmmm, that is strange and really shouldn’t be happening 🤔  
Can you put this into a little example project? Will make it super quick to get to the bottom of and fix!

---

<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:** [April 9, 2025, 11:40am UTC](https://forums.realmacsoftware.com/t/odd-issue-with-portal-headend/47085/3 "2025-04-09T11:40:36Z")

</div>

Hi Dan,

I tried to send provately but it gave me an error. Nothing useful to anyone else in this anyway!

Thanks for looking at this. Here is a link to a very simple example. The code is in the testcomp component which is on the home page. Doesn’t actually show anything as I stripped everything out to keep it simple.

elementsapp://downloadDocument/UnY8zrSVusjE

---

<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:** [April 9, 2025, 12:33pm UTC](https://forums.realmacsoftware.com/t/odd-issue-with-portal-headend/47085/4 "2025-04-09T12:33:16Z")

</div>

Perfect, thanks for this. We’ll dig in and see what’s going on!

---

<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:** [April 9, 2025, 5:26pm UTC](https://forums.realmacsoftware.com/t/odd-issue-with-portal-headend/47085/5 "2025-04-09T17:26:23Z")

</div>

@vibralogix this should be [fixed in Today’s build](https://forums.realmacsoftware.com/t/elements-0-7-4-23453/47091/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:** [April 10, 2025, 6:59am UTC](https://forums.realmacsoftware.com/t/odd-issue-with-portal-headend/47085/6 "2025-04-10T06:59:38Z")

</div>

That’s great. Thanks Dan
