conflict with theme and/or module

Events happening in the community are now at Drupal community events on www.drupal.org.
cdragin's picture

I have a project where I'm reorganizing the content for a client (moving blocks around, changing menus), potentially installing and configuring some new modules, and putting it all in a new theme that I have designed using BlueprintCSS. I should also mention this is my first from-scratch theme, and my first time using Blueprint.

I built the theme on my local server on a fresh drupal install and it works just fine. I have a mirror of my client's site on their server, and when I enable my new theme, it isn't seen at all—it basically just shows the page with no styles. I believe I've found what's causing the problem, but am not clear where it's coming from or how to fix it.

In the live, working site (which uses the "Ability" theme), there is google analytics code both in the footer (where I'd expect it to be) and also in a div in the middle of the content. The pertinent part of the code is this:

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

When I enable my theme, the code also appears in the header, in the meta description (there is no meta description in the original site). The "var gsHost" code is the value for content= in the meta description, and it truncates google-analytics to go..., and turns half the page into one big link (see attachment)

Even after disabling the google analytics module—in fact, after disabling ALL the modules—I still get this. Any clues?

AttachmentSize
heads compared.doc21.5 KB

Comments

Tricky

JuliaKM's picture

Hey Claire,

Does your custom theme have $scripts and $closure tags in page.tpl.php?

Julia

scripts and closure

cdragin's picture

Yes, it does have them.

I read something about another problem that involved having a class="content". I have a region called content, is that a possible conflict?

class="content"

JuliaKM's picture

I think that having a region named $content could be a conflict because that's a variable used elsewhere. Does it work if you rename your region?

region "content"

cdragin's picture

"content" is used as a region name in the original blueprint.info file, and it's also used in an example in the Drupal 6 Themes book.

reply

design_dog's picture

What did that last comment mean? Did that mean you fixed it?

Why this thing is spitting out the script in the meta section or acting the way it is - output [body] then broke; makes me tend to think it is a problem with your code in your theme .tpl file(s).
Could be as simple as missing or having an extra "< div >" tag???

As crazy as it may sound the only other thing I can think of is if by mistake you installed the wrong version? ?crazy guess.

I'm not familiar with google analytics module too much. Not sure what the big benefit is over adding it yourself by putting it into your own theme files vs. installing this module.

You might want to just try manually installing the code for say the homepage for starters of the google code straight from google and disengage the module.

I don't see how it might be $content or region def that's the problem other than if anything an actual class, class="content"

You might want to try attaching or pasting the code for you main .tpl file, say "page.tpl.php" for someone to look at if it isn't fixed yet. (or a link to the site.)
I'll take a look at it.

Unless, of course, you want to post on drupal.org forum, you should also get help since this involves code.

Looking at your .doc I see 2

jacine's picture

Looking at your .doc I see 2 things that jump out at me:

  1. Your live site is using an XHTML 1.1 Strict doctype and your custom theme is using XHTML 1.0 Transitional.
  2. This is wrong on a few levels:

<meta name="description" content="var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "go..." />

  • You can't have Javascript in HTML without tags, so this is likely breaking your HTML. Validation would tell you this straight away.
  • A meta description is usually a description of the page content, so my first reaction is that this code doesn't belong there at all. I could be wrong, but I've never seen Javascript used here, especially not to load in a Javascript file, which is what this "script" is trying to do to.

PS - Next time post the code in your post as opposed to in .doc :)

found the problem(s)

cdragin's picture

Marc Ray at rightsprocket.com was able to help me out on this (Thanks marc!)

-the client had entered some google analytics code in the content area, which conflicts with the blueprint framework. So the problem actually had nothing to do with my theme code after all.

-I always use a separate admin theme when designing, but I had used some wonky custom names on regions, which didn't show up on the admin blocks page, because the admin blocks page was using the admin theme, not my theme. Live and learn.