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 Snippet for Profile
Pages: [1]

Author Topic: HTML Snippet for Profile  (Read 1517 times)

jimurl

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 0
  • CiviCRM version: 3.4.6
  • CMS version: drupal 6.22
  • MySQL version: 5+
  • PHP version: 5+
HTML Snippet for Profile
March 10, 2011, 08:48:57 am
Hello everyone,

I am working to get Civicrm set up for a small business, and have run into a problem using the HTML Form snippet code. Using drupal 6.20, Civicrm 3.3.5, here is what I am seeing: It appears that the css and js code is not being included properly.

If I take the HTML form snippet and paste it into a different domain (different subdomain, actually), the layout of the page is broken. ( this is also a drupal site, actually, it is a sister site in a multi-site setup)

If I paste the HTML form snippet into the drupal site where CIVICRM lies, the layout works fine, as long as I am logged in. If I am NOT logged in, the layout is broken.

If the HTML is pasted into a completely third party site, the formatting isn't correct either.

By broken formatting, here is an example: we have several countries in the standard select list-when the country is changed, a select list of states/provinces is updated to reflect the states and provinces of that new country. This doesn't get updated by the js - the choices remain the U.S. states. Also, the nice right-left alignment of field names and blank fields is disrupted.

Any ideas on this?


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: HTML Snippet for Profile
March 10, 2011, 10:50:05 am

this is due to cross domain javascript and security on different sites.

The logged in / not logged in issue might be a permissions issue. Would be great if you can use firebug and see which ajax queries are failing and/or why the layout is different

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jimurl

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 0
  • CiviCRM version: 3.4.6
  • CMS version: drupal 6.22
  • MySQL version: 5+
  • PHP version: 5+
Re: HTML Snippet for Profile
March 11, 2011, 12:49:07 pm
Thanks Lobo, this helps.

The cross-domain js scripting, and security- that makes sense.

But looking at the page with the snippet that IS on the domain in question:
I found several civicrm css files that weren't being loaded: deprecate.css, civicrm.css and extras.css. These are not present when anonymous users view the page which has the profile form snippet on it, or when a user with a 'low-grade' role (including 'authenticated') is logged in.

When a user with an 'admin' role views these pages, the page includes references to those css files. I am not sure what determines whether those css files are included or not. I tried giving anonymous and authenticated greater permissions within drupal- including 'access civicrm' and 'profile listings'. Still, no dice.

For the time being, I will probably include references to these css files at the drupal theme layer. But that's not my preferred solution. Perhaps the issue lies with a configuration at the civicrm permissons level (ACLs)?

There is another drupal module I am using that might be screwing this up as well: IE Unlimited CSS Loader, http://drupal.org/project/unlimited_css
It works around a limitation in which IE only loads 31 stylesheets per page and the admin can't combine css files in admin/settings/performance . It uses @import to include the css files. I don't see how that would affect things, but perhaps its pertinent.

Any ideas on how I might chase down this issue are appreciated.



petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: HTML Snippet for Profile
March 11, 2011, 01:11:02 pm
Turn off that module, and enable css aggregation to confirm if tht is interfering?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

jimurl

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 0
  • CiviCRM version: 3.4.6
  • CMS version: drupal 6.22
  • MySQL version: 5+
  • PHP version: 5+
Re: HTML Snippet for Profile
March 18, 2011, 04:04:49 pm
"...and enable css aggregation" ---

Within drupal, I am using the 'drupal handles file transfers' rather than 'file transfers by http directly' option in Settings->File System.

This means I can't enable css aggregation- I think the aggregated css file lies (usually) in sites/default/files - which isn't used if drupal is handling file transfers.

I ended up working around it pretty easily by just importing those files just before the form snippet- that works fine, but a little ugly.

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

This forum was archived on 2017-11-26.