Skip to main content
retag
Source Link
choster
  • 1.9k
  • 12
  • 38

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

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

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

Tried to clean up the code snippet to display the relevant portion in indented code format; clarified the issue
Source Link

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.

var CRM = {"config":{"ajaxPopupsEnabled":true,"isFrontend":""}}; First Name * Last Name * Email * Cancel
<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

When our users create an html snippet, 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 the code for a form that just has first name, last name and email address.

var CRM = {"config":{"ajaxPopupsEnabled":true,"isFrontend":""}}; First Name * Last Name * Email * Cancel

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

fixed the default formatting that is produced by the html snippet action so that it is more readable for this site
Source Link

When our users create an html snippet, 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 the code for a form that just has first name, last name and email address.

var CRM = {"config":{"ajaxPopupsEnabled":true,"isFrontend":""}};
<div class="crm-profile-name-Sign_Up_for_our_Newsletter_46">


<div id="crm-container" class="crm-container crm-public" lang="en" xml:lang="en">

  <div id="editrow-first_name" class="crm-section editrow_first_name-section form-item"><div class="label"><label for="first_name">  First Name
 <span class="crm-marker" title="This field is required.">*</span>

Last Name *

Email *

Cancel

CRM.$(function($) { cj('#selector tr:even').addClass('odd-row '); cj('#selector tr:odd ').addClass('even-row'); });

First Name * Last Name * Email * Cancel

When our users create an html snippet, 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 the code for a form that just has first name, last name and email address.

var CRM = {"config":{"ajaxPopupsEnabled":true,"isFrontend":""}};
<div class="crm-profile-name-Sign_Up_for_our_Newsletter_46">


<div id="crm-container" class="crm-container crm-public" lang="en" xml:lang="en">

  <div id="editrow-first_name" class="crm-section editrow_first_name-section form-item"><div class="label"><label for="first_name">  First Name
 <span class="crm-marker" title="This field is required.">*</span>

Last Name *

Email *

Cancel

CRM.$(function($) { cj('#selector tr:even').addClass('odd-row '); cj('#selector tr:odd ').addClass('even-row'); });

When our users create an html snippet, 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 the code for a form that just has first name, last name and email address.

var CRM = {"config":{"ajaxPopupsEnabled":true,"isFrontend":""}}; First Name * Last Name * Email * Cancel
Source Link
Loading