Calling XPages Gurus (CSS Question)
Category xpages
So I have an xpage, inside that xpage, there are two Custom Controls ... the visual header and footer of the page ... in the header custom control, I load all my common CSS files, in the proper order I want them called ..
Then, in the xpage itself, I want to load another CSS file, specific to that xpage. That CSS overrides CSS defined in the linked style sheets that are included in the Header Custom Control, so the <link> in the generated HTML needs to appear after the CSS <links> from the header. In the XML code, the header is defined before the stylesheet resource, as below...
<xc:yb-header></xc:yb-header>
<xp:this.resources>
<xp:styleSheet href="/default.css"></xp:styleSheet>
</xp:this.resources>
However, the server always outputs the style sheets defined in the XPage first, then any in the included custom controls. If I look at the Styles property box, the only style sheet shown is the one from the xPage, not anything defined in the custom control. So I can't specify to load those before the custom control.
Does anybody know a way to tell xpages the order of to load the linked CSS files, including the ones in the custom control? I'd hate to have to define them each time in the xpage itself.
So I have an xpage, inside that xpage, there are two Custom Controls ... the visual header and footer of the page ... in the header custom control, I load all my common CSS files, in the proper order I want them called ..
Then, in the xpage itself, I want to load another CSS file, specific to that xpage. That CSS overrides CSS defined in the linked style sheets that are included in the Header Custom Control, so the <link> in the generated HTML needs to appear after the CSS <links> from the header. In the XML code, the header is defined before the stylesheet resource, as below...
<xc:yb-header></xc:yb-header>
<xp:this.resources>
<xp:styleSheet href="/default.css"></xp:styleSheet>
</xp:this.resources>
However, the server always outputs the style sheets defined in the XPage first, then any in the included custom controls. If I look at the Styles property box, the only style sheet shown is the one from the xPage, not anything defined in the custom control. So I can't specify to load those before the custom control.
Does anybody know a way to tell xpages the order of to load the linked CSS files, including the ones in the custom control? I'd hate to have to define them each time in the xpage itself.
PS: And if there isn't a way ... one of
you Design Partners ought to nibble the ear of the developers ... CSS links
should be listed in the order they appear top to bottom of the xpage, including
custom controls .... its the CASCADING in CASCADING style sheets ...














- 
Comments
Posted by 2012 calendar printable ideeas At 06:28:51 AM On 11/07/2011 | - Website - |
Posted by angled bob hairstyles 2012 ideea At 11:54:22 AM On 10/26/2011 | - Website - |
Posted by bedroom colors for 2012 At 09:29:02 AM On 10/07/2011 | - Website - |
Posted by cost of composite decking At 05:30:37 AM On 10/06/2011 | - Website - |
.. as for the order, I agree if you think of the xpage/component as a hierarchy, and assume that's what ultimately determines what CSS markup gets applied where in the browser, but it's not ... you can order the XML of the xpage in (about) any order in the code ... like my sample above, the header custom control comes before the resource definition ... the processing of everything I would think should be linear as it parses the source ... CSS is so dependent upon the order of appearance (in the page) to determine the proper markup to apply to the elements. Othwerwise the compiler is making a guess as to what I as the develop has intended, and has a great chance of getting it wrong.
Posted by Jeremy Hodge At 08:18:40 PM On 07/02/2009 | - Website - |
And if you think about it, the way your currently doing it and the way it's outputting the css is correct. First is the css defined in the actual xpage and then the css defined in any custom controls in the order the cc appears in the xpage.
Posted by Declan Lynch At 08:02:00 PM On 07/02/2009 | - Website - |