0

For the life of me I cannot get a javascript file to load / be added correctly to an expression Template file (Ie.: _footer)

I've tried all these and nothing.

<script src="{base_url}/scripts/main"></script>

<script src="{base_url}/scripts/main.js"></script>

<script src="{base_path}/scripts/main.js"></script>

Thank you for any input

1 Answer 1

0

I recommend you check out this article which goes about explaining how to set up templates, including partials, layout etc. It says it all far better than I could.

Templating Intro (ExpressionEngine University)

To answer your question though, you want to use the site_url variable.

<script src="{site_url}/scripts/main.js"></script>
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. I ended up pointing to it that way.
I did more research into this, and found the proper solution for you. The answer has been updated to reflect the change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.