CSS created in CPN is very specific to each node and usually helps with overriding default values. In current release, these values can't be overriden since the CSS file is put above all theme related CSS files.

We need to add 'group' to the attached property.

Patch attached.

CommentFileSizeAuthor
#2 cpntheme.patch1014 bytesrobloach
#1 cpn.patch33.38 KBrobloach
cpn.patch1018 bytesmeba

Comments

robloach’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new33.38 KB

Yup!!! Minus the "^M".

robloach’s picture

StatusFileSize
new1014 bytes

Wrong patch... Here's the right one.

joelstein’s picture

Title: In Drupal 7, CSS and JS should be attached to the end » Move CSS and JS to theme group
Status: Reviewed & tested by the community » Fixed

Thanks for catching this and for providing the patches. Fixed in 7.x-1.1.

http://drupalcode.org/project/cpn.git/commit/01861a3
http://drupal.org/node/1080458

Status: Fixed » Closed (fixed)

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

attheshow’s picture

Version: 7.x-1.x-dev » 6.x-1.2
Status: Closed (fixed) » Active

Is there any chance this can be fixed in D6 too since it's a bug?

Currently in D6, the node-specific stylesheets are still inserted before the theme's stylesheets, so the site-wide theme styles end up overriding CPN styles (unless they're super-specific).

zachfls’s picture

Can I get a bump on this for D6? I've got the latest version of CPN for Drupal 6 and I'm having the same problem. I specifically need this to override the default styling for a few of my main div containers, but since the CPN styles get placed before the default theme styles, this ends up being completely useless for me.

I'd be willing to help work on a patch if someone with a little more know how on whether the the D7 patch would be similar to a D6 solution. I haven't worked with D7 at all yet.

zachfls’s picture

For any D6 users who really need this to work, I came up with a bit of a temporary work around.

In my theme's template_preprocess_page hook I added a function that reads the vars['styles'] value of the form and sorts any css styles being linked from the cpn directory to the bottom of the stylesheet list.

It has, for the time being, solved the problem for me. But this really should be fixed in the module.

damienmckenna’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Status: Active » Patch (to be ported)
damienmckenna’s picture

Issue tags: +Needs backport to D6

Tag.

damienmckenna’s picture

Status: Patch (to be ported) » Fixed
Issue tags: -Needs backport to D6

The D6 code already does this, e.g.:

          drupal_add_css($css, 'theme');

Status: Fixed » Closed (fixed)

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