Logo 
Search:

MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

export/import web part breaks custom styling

  Asked By: Sade    Date: Mar 14    Category: MOSS    Views: 1465

I thought we had this all figured out and done.

We have a highly customized DFWP and a custom css stylesheet on MOSS site. All
customizations (xsl & css) are in files at site-collection root in /Style
Library/. Works fine on our demo/test sub-site.

Now we want to export this WP, then import it so we can get it into WP gallery.
We then want to use the gallery version to retro-fit ~50 sub-sites in the same
site-collection. When we do this, it works except all styling has been lost.

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Sumitra 2004     Answered On: Mar 14

Didn't you say that you found once you went more than one level off from
the Site Collection that you needed to use the absolute URL? Why not just use
the absolute everywhere for this one? Make sure you put it in your will (i.e.
leave plenty of comments) that this was done for this particular DFWP.

 
Answer #2    Answered By: Bhairavi Damle     Answered On: Mar 14

Yes I tried using absolute URL for the <link> tag also.

BUT, looking at the exported WP, one sees that there is NO hint of
styling/decorations in it. It contains the data source stuff, the CAML (if any),
and a ref to my stylesheet (which contains the XSL code).

So there should not be any css or its links there. AFter all, you can put any
web part on any page and it comes up with the css styles for that page.

So how do I get a WP on a sub-site home page (default.aspx) to utilize the css
file I have put into the /Style Library/ ? All of my other experiments were
with an aspx page created with SPD and put into a DocLib. For these I text
edited the <link> tag into a asp.content section about "additionalheadertable".

 
Answer #3    Answered By: Leeann Hull     Answered On: Mar 14

Add a cssregistration for the custom css file to the masterpage used in the
site collection. Then add class= declarations to your XSL file to apply the
css classes.

 
Answer #4    Answered By: Vaasu Radhakrishna     Answered On: Mar 14

You know there are three different CSS files to look at right? Maybe more now
that you are adding your own. If your webpart is actually rendering after your
styles have been applied then your webpart may be looking for the styles from
the default locations first. Figure out a way to delay loading your particular
styles until after the page is rendered.

Since jQuery is my silver bullet take a look here:
www.rickardnilsson.net/.../Applying-stylesheets-dynamically-w\
ith-jQuery.aspx

I'll simplify what they showed (no need to attach to a click event):

$(document).ready(function() {
$('head').append('<link rel="stylesheet" href="style2.css" type="text/css"
/>');
});

 
Answer #5    Answered By: Brinda Bca     Answered On: Mar 14

Well, I've sort of got it working. Took Paul's suggestion about the CSS. It
turns out there a multiple issues to consider & over come, hope this list helps
others:
1)retro-fitting sites (~50) vs. new sites going forward (1/mo),
2)one place to modify CSS, one place to modify XSL,
3)misleading info posted in Blogs,
4)aspx pages in DocLibs not behaving identical to default.aspx site home pages,
5)proper syntax for <xsl:include> <link...> & <xsllink> seeming to differ
depending how deep in site-collection you are,
6)two ways in UI to add custom XSL to a WP: the "source pane", or Misc>XSL Link
pane,
7)SPD building incorrect paths sometimes,
8)check-in, check-out behavior not consistent between UI & SPD, nor between
DocLib pages and site home pages,
9)UI browser view of result inconsistent with SPD's "split, preview pane".

Hoepfully my last Q on this:
is there anyway that I can put a link into my WP which points to a file whose
2-3 line content points to another file which actually contains my custom XSL?

 
Didn't find what you were looking for? Find more on export/import web part breaks custom styling Or get search suggestion and latest updates.




Tagged: