for some reason l'm getting the wrong advanced_profile.css path rendered here is a clip on my source

<style type="text/css" media="all">@import "/sites/all/modules/cck/fieldgroup.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/panels/css/panels.css";</style>
<style type="text/css" media="all">@import "//advprofile/advanced_profile.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/panels/layouts/flexible.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/panels/layouts/twocol.css";</style>
<style type="text/css" media="all">@import "/modules/comment/comment.css";</style>

Comments

blairski’s picture

I had a similar problem, except for me, the path to the CSS file included the theme name twice.

I have had a look at the advance profile module and the problem relates to this code:

// Add in the CSS for the user profile page
drupal_add_css($vars['directory'] . '/' . $profile_theme .'/advanced_profile.css');

I replaced it with this and this fixed it:
drupal_add_css('themes/' . $profile_theme .'/advanced_profile.css');

This may not work for you if your theme is not in the theme folder. Michelle, will you be able to fix this in the module itself?

michelle’s picture

Status: Active » Fixed

bustaboy - I did some asking around and it turns out the directory variable is not reliable. It's always worked for me so I figured I'd use that and save a function call. But I guess there's some times when it doesn't work. So I'm going to replace it with this:

    // Add in the CSS for the user profile page
    drupal_add_css(path_to_theme() . '/' . $profile_theme .'/advanced_profile.css');

It will be a while before I do alpha 3 so just go ahead and patch yours for now and it will be fixed whenever I get it out.

blairski - That path is totally wrong. That would come out to '/themes/advprofile/advanced_profile.css' which isn't where it should be at all.

blairski’s picture

Michelle,

The path I used works for me!

Your new one does not work. It produces the following CSS path:

@import "/dev/themes/blairski_template/blairski_template/advprofile/advanced_profile.css"; So the template directory is being added twice, which is what the orginal function was doing. I think both path_to_theme and $profile_theme are adding the template directory, hence it is showing up twice in the path
michelle’s picture

$profile_theme is the path from your directory to the profile theme. Which is going to be simply "advprofile" unless you changed it in settings. If you're getting it twice, then something is screwed up on your site. So bustaboy needs to use the code I pasted, not yours, or it won't work for him.

Michelle

bustaboy’s picture

thanks Michelle,

works like a charm

michelle’s picture

Great, glad to hear it!

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.