# Custom Component & Template Areas

**URL:** <https://forums.realmacsoftware.com/t/custom-component-template-areas/44273>\
**Category:** Elements API\
**Created:** [August 14, 2024, 3:08pm UTC](https://forums.realmacsoftware.com/t/custom-component-template-areas/44273 "2024-08-14T15:08:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [August 14, 2024, 3:08pm UTC](https://forums.realmacsoftware.com/t/custom-component-template-areas/44273/1 "2024-08-14T15:08:31Z")

</div>

It would be useful if a Custom Component could add code to a selected page template area (if that is the correct term) via an API call. I am working on securing a page with Sitelok that requires adding code at the start of the page and in the header.

This would mean that a user could just drag an “initialisation” Custom Component onto the webpage (HTML?) and configure the requirements for the page using the property editor. It would avoid a user having to add code into these two areas.

In Foundry there are a number of stacks that use this concept.

---

<div class="post-metadata">

**Author:** ![anon68150607](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@anon68150607](https://forums.realmacsoftware.com/u/anon68150607)\
**Post date:** [August 14, 2024, 4:20pm UTC](https://forums.realmacsoftware.com/t/custom-component-template-areas/44273/2 "2024-08-14T16:20:30Z")

</div>

I could see this being useful when creating components for things such as [Hype](https://tumult.com/hype/), [Keyshape](https://www.keyshapeapp.com) and [Lottie](https://lottiefiles.com) animations. Ideally you’d want only one copy of any required scripts, styles, preloads, etc added to the page even if the user has added multiple components/animations/etc to the page.
