Does ExpressionEngine have a way to refer to a static media folder in a template like Django's {{ MEDIA_URL }}?
It would be nice to be able to refer to a set "static" folder as a variable instead of having to keep track of a specific URL that might need to be changed if static media gets moved to a CDN later on.
For example, this:
<script src="{static_media}/js/jquery-1.4.min.js"&开发者_StackOverflow社区gt;</script>
Instead of this:
<script src="/static/js/jquery-1.4.min.js"></script>
You can just go into the "Template" section of the backend to create a global variable for any other strings you'd like to create a global variable for.
See here: http://expressionengine.com/docs/templates/globals/user_defined.html
精彩评论