Quick Nav:  Online Store   |   Login | Register

CSS Merge bug

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Page 1 of 212 > >>
AuthorMessages
Lance Long
<20 Posts
Posts:3


06/19/2008 5:15 PM  

John,

I found a hook in the CSS merge function - it merges conditionally included files

I embed an IE6 and lower style sheet in a conditional statement with the aid of PageBlaster (I replace a head comment with the statement).  The CSS merge function is incorrectly merging this file with the regular style sheet thus applying the overrides for all browsers.  Can PB ignore any content (JS also) found inside the conditional statements.  If so, can it insert the merged files above these statements (or it will again render the overrides pointless)?  Perhaps if we could put a marker in default.aspx where we want Pageblaster to insert content?  This marker could override the default now employed.

Lance

Lance Long
<20 Posts
Posts:3


06/19/2008 5:22 PM  

I suppose CSSmerge should also leave Media="print" and Media="handheld" style sheets alone and below as well.  I don't know if it does as I can't run the feature but it should none the less.

Lance Long
<20 Posts
Posts:3


06/19/2008 5:25 PM  
BTW, I really like the feature and hope these change can take place. I have been annoyed by the default, portal, skin, container separation since day one. IMHO, DNN falls a bit short by not (M)anaging this type of (S)ystem (C)ontent.
llong
<100 Posts
Posts:96


06/19/2008 5:27 PM  
I agree Lance! (I guess I got a new account with the purchase)
John Mitchell
Posts:3196


06/19/2008 5:34 PM  
You're right. That would be a problem if a commented link was merged into the single file.
I'll look into skipping over any links inside comments.

For now, you can exclude these yourself by putting their name in an exclude path / pattern:

< path pattern="IE6.css" excludeFrom="CSSMerge" />
llong
<100 Posts
Posts:96


06/19/2008 5:36 PM  
So I guess the print and handheld issue should be solved by adding:
< path pattern="handheld" excludeFrom="MergeCSS" />
< path pattern="print" excludeFrom="MergeCSS" />
llong
<100 Posts
Posts:96


06/19/2008 5:42 PM  

Yes, that rule and mine worked to exclude the files.

However, the new file is still below the statement rendering it useless.

I have the follow in the head to insert this content:

< !--head-->
< /head>

How can I get PB to insert before this?

John Mitchell
Posts:3196


06/19/2008 6:06 PM  

PageBlaster only checks the filename and path the part in the href attribute for excludes of CSSMerge & CSSMin.

John Mitchell
Posts:3196


06/19/2008 6:09 PM  

I'm not following the part about the statement being in the wrong place, can you show me an example?

Attach in a text file if there is html code.

llong
<100 Posts
Posts:96


06/19/2008 6:18 PM  
Certainly, check this site:

http://www.duhaime.org/

You will see style sheets for Print, Handheld and IE6 which are to override the skin styles. I add these by replacing a comment (< !--head-->) I inserted into default.aspx. (I'm not comfortable replacing the head tag as errors could be disastrous.) PB does its wonderful job merging the normal style sheets but then inserts them below the previously mentioned three. This overrides them instead of the other way around rendering them useless.
John Mitchell
Posts:3196


06/19/2008 9:39 PM  
Ok, I see now. The merge process does add the merged file back in right before the closing head tag.
I needed to put it someplace in the head, and I figured the bottom of the head tag would be best.

You could create a rule to move it back to a position right after the opening head section.
There are some rules close to doing that in the group that moves the DNN JS files.
Let me know if you need any help with that rule.
llong
<100 Posts
Posts:96


06/20/2008 9:53 AM  
I think I can figure that out. The longer term fix I recommend is the new file replaces the last file it merges. This would be the best method for all cases (CSS, JS).
llong
<100 Posts
Posts:96


06/20/2008 12:07 PM  

It seems the CSS routine runs after the portal replacements. It was getting too tricky to find and move the line ( * # of sites on portal). Any chance you will consider the placement suggestion above?

John Mitchell
Posts:3196


06/20/2008 12:17 PM  
Ooops, you're right Merge runs after Replacements.

I've been looking at your idea of putting the merged file back in at the place of the last one pulled in.
It'll take some extra processing, but I should be able to do it.

You could also move your conditional css just below the /head> and save having to exclude it.
llong
<100 Posts
Posts:96


06/20/2008 12:23 PM  
That would be a temporary fix, non-complaint however.

For now I have disabled the feature.
John Mitchell
Posts:3196


06/20/2008 2:49 PM  

Hi Lance,

I have modified the attached dll so that the merge css file link gets placed back in the position of the last original css link in the head section.


Attachment: 1620491482771.zip

llong
<100 Posts
Posts:96


06/20/2008 3:03 PM  
Thank you! I assume this isn't a stem and will make it's way into other updates?
John Mitchell
Posts:3196


06/20/2008 3:12 PM  
Yes, you assume correctly in this matter.
Thanks for the idea.
llong
<100 Posts
Posts:96


06/20/2008 5:23 PM  
I have a new bug after uploading this.

On some of the CSS background sources are listed as :
/Portals/duhaime/Skins/duhaime-new/http:/www.duhaime.org/Portals/duhaime/images/arrow.gif or
/Portals/duhaime/Skins/duhaime-new/Portals/duhaime/images/arrow.gif
When they should be:
/Portals/duhaime/images/arrow.gif. All my sources are root relative.

Is the process translating paths at all? If so, how do you control this?
John Mitchell
Posts:3196


06/20/2008 5:28 PM  
Yes, it does make the paths root relative since the merged file is in it's own folder.

Something may have happened to it detecting if it is already root relative.
I'll have to debug it and see.
Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Page 1 of 212 > >>




ActiveForums 3.7
Powered by: Snapsis Software