CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • HTML Form Snippet Smarty Error
Pages: [1]

Author Topic: HTML Form Snippet Smarty Error  (Read 6032 times)

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
HTML Form Snippet Smarty Error
February 05, 2013, 08:47:11 pm
I created a profile to allow the signup to a newsletter. I grabbed the HTML code for the form snippet and pasted the code into the source of a blog post. That generated a smarty error when trying to display it. I thought maybe it was because it was in the blog post so I created a block and pasted the code into the source  of a wysiwyg full html block. Same thing I get a smarty error.

I seem to recall reading that sometimes you have to put the code within a tag or some sort to make it work. I have searched and can't seem to find that. Can someone tell me what I'm doing wrong?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: HTML Form Snippet Smarty Error
February 08, 2013, 05:18:33 am
What is the error you get?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: HTML Form Snippet Smarty Error
February 08, 2013, 10:06:23 am
Code: [Select]
User error: Smarty error: [in string: @import url("http://saintfrancisocc.org/sites/all/modules/civicrm/packages/jquery/jquery-ui-1.8.16/css/smoothness/jquery-ui-1.8.16.custom.css"); @import url("http://saintfrancisocc.org/sites/all/modules/civicrm/packages/jquery/css/jquery.autocomplete.css"); @import url("http://saintfrancisocc.org/sites/all/modules/civicrm/packages/jquery/plugins/jstree/themes/default/style.css"); @import url("http://saintfrancisocc.org/sites/all/modules/civicrm/packages/jquery/css/menu.css"); @import url("http://saintfrancisocc.org/sites/all/modules/civicrm/packages/jquery/css/token-input-facebook.css"); @import url("http://saintfrancisocc.org/sites/all/modules/civicrm/packages/jquery/plugins/DataTables/media/css/demo_table_jui.css"); @import url("http://saintfrancisocc.org/sites/all/modules/civicrm/packages/jquery/css/dashboard.css");var cj = jQuery.noConflict();

 

 

 


If you would like to create an account on this site, check the box below and enter a user name and a password. By creating an account you will be able to update your full contact information. If you already have an account, please login before completing this form.
Create an account?
Username
Check Availability
Your preferred username; punctuation is not allowed except for periods, hyphens, and underscores.
Password
Confirm Password

Provide a password for the new account in both fields.

if ( document.getElementsByName("cms_create_account")[0].checked ) { show('details'); } else { hide('details'); } function showMessage( frm ) { var cId = ''; if ( cId ) { alert('You are logged-in user'); frm.checked = false; } else { var siteName = 'http://saintfrancisocc.org/'; alert('Please login if you have an account on this site with the link ' + siteName ); } } var lastName = null; cj("#checkavailability").click(function() { var cmsUserName = cj.trim(cj("#cms_name").val()); if ( lastName == cmsUserName) { /*if user checking the same user name more than one times. avoid the ajax call*/ return; } /*don't allow special character and for joomla minimum username length is two*/ var spchar = "\<|\>|\"|\'|\%|\;|\(|\)|\&|\\\\|\/"; spchar = spchar + "|\~|\`|\:|\@|\!|\=|\#|\$|\^|\*|\{|\}|\\[|\\]|\+|\?|\,"; var r = new RegExp( "["+spchar+"]", "i"); /*regular expression \\ matches a single backslash. this becomes r = /\\/ or r = new RegExp("\\\\").*/ if ( r.exec(cmsUserName) ) { alert('Your username contains invalid characters'); return; } if (cmsUserName) { /*take all messages in javascript variable*/ var check = "Checking..."; var available = "This username is currently available."; var notavailable = "This username is taken."; //remove all the class add the messagebox classes and start fading cj("#msgbox").removeClass().addClass('cmsmessagebox').css({"color":"#000","backgroundColor":"#FFC","border":"1px solid #c93"}).text(check).fadeIn("slow"); //check the username exists or not from ajax var contactUrl = "http://saintfrancisocc.org/civicrm/ajax/cmsuser"; cj.post(contactUrl,{ cms_name:cj("#cms_name").val() } ,function(data) { if ( data.name == "no") {/*if username not avaiable*/ cj("#msgbox").fadeTo(200,0.1,function() { cj(this).html(notavailable).addClass('cmsmessagebox').css({"color":"#CC0000","backgroundColor":"#F7CBCA","border":"1px solid #CC0000"}).fadeTo(900,1); }); } else { cj("#msgbox").fadeTo(200,0.1,function() { cj(this).html(available).addClass('cmsmessagebox').css({"color":"#008000","backgroundColor":"#C9FFCA", "border": "1px solid #349534"}).fadeTo(900,1); }); } }, "json"); lastName = cmsUserName; } else { cj("#msgbox").removeClass().text('').css({"backgroundColor":"#FFFFFF", "border": "0px #FFFFFF"}).fadeIn("fast"); } }); var trigger_field_id = 'cms_create_account'; var trigger_value = ''; var target_element_id = 'details'; var target_element_type = 'block'; var field_type = 'radio'; var invert = 0; showHideByValue(trigger_field_id, trigger_value, target_element_id, target_element_type, field_type, invert);
First Name *
 
Last Name *
 
Email *
 
Church
 

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: HTML Form Snippet Smarty Error
February 09, 2013, 11:27:02 am
Hmmm, what is the filtering on your Drupal nodes or blocks? Can you try plain text or a text input format without WYSIWYG?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: HTML Form Snippet Smarty Error
February 09, 2013, 12:46:31 pm
The text input is Full HTML. I wanted the form to be at the bottom of a paragraph instead of in a block. I'll try it in a plain text block.

Interesting, plain text doesn't work. I switched the input to PHP Code and it works perfectly.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: HTML Form Snippet Smarty Error
February 10, 2013, 02:53:40 am
The issue is the filters Drupal applies to your inputs. PHP mode uses no filters.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

FrTommy

  • I post frequently
  • ***
  • Posts: 273
  • Karma: 2
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.5.32
  • PHP version: 5.3
Re: HTML Form Snippet Smarty Error
February 10, 2013, 11:41:27 am
I thought that might be the case after it worked in the php mode. Thanks!!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • HTML Form Snippet Smarty Error

This forum was archived on 2017-11-26.