Skip to main content
4 of 4
retag
choster
  • 1.9k
  • 12
  • 38

Why does the html snippet for a profile not include the url of the site for linked Jscript and css files?

When our users create an html snippet for a Profile, it requires a lot of editing to get the references to work. I don't understand why it's written that way.

For reference, here's a snippet of the code for a form that just has first name, last name and email address.

<script type="text/javascript">
var CRM = {"config":{"ajaxPopupsEnabled":true,"isFrontend":""}};
</script>  
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/jquery-1.11.1.min.js?r=ogWA8">
</script>  
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/jquery-ui/jquery-ui.min.js?r=ogWA8">
</script>  
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/backbone/lodash.compat.min.js?r=ogWA8">
</script>  
<script type="text/javascript" src="/sites/all/modules/civicrm/packages/jquery/plugins/jquery.mousewheel.min.js?r=ogWA8">
</script>  

These snippets are used on different websites than the one where CiviCRM is installed, so the local (non-absolute URL) src="/sites/all/... references don't work correctly.

NOTE: The Help text does indicate that this snippet should work on "ANY website":

Profile HTML Snippet help