ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using site_url

August 09, 2012 5:01pm

Subscribe [2]
  • #1 / Aug 09, 2012 5:01pm

    ramonekalsaw

    377 posts

    Hello,

    I trying to set up a dev site in MAMP and am having trouble getting my css and javascript assets hooked up.

    The URL to the root directory of my site is localhost:8888/mysite/

    I have my JS and CSS code in an /assets/ folder off the site root in mysite/assets/css/ and mysite/assets/js/. 

    My question is this: When using ‘site_url’ to return the root path to where my EE install is located … would it be:

    src=”{site_url}assets/js/...  or src=”{site_url}mysite/assets/js/...  ?

    Thanks.

  • #2 / Aug 10, 2012 1:15pm

    Shane Eckert

    7174 posts

    Hey ramonekalsaw,

    The site_url variable will be substituted with your site URL as defined under Admin > General Configuration.

    So site_url}assets/js/ should work. Does it not?

    Thank you,

  • #3 / Aug 10, 2012 2:53pm

    ramonekalsaw

    377 posts

    Hey ramonekalsaw,

    The site_url variable will be substituted with your site URL as defined under Admin > General Configuration.

    So site_url}assets/js/ should work. Does it not?

    Thank you,

    Frustratingly no : /

    But I’ll bang around a bit more to see if it jogs loose ...

    ... just wondering ... is a / after site_url necessary?

    site_url}/assets/js/

    Thanks.

  • #4 / Aug 10, 2012 4:17pm

    Shane Eckert

    7174 posts

    Hey ramonekalsaw,

    The slash is only necessary if you did not include that in Admin > General Configuration.

    Does that make sense?

    Thanks,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases