Categories





IM me on the bleedyellow.com sametime community - jeremy.hodge@zetaone.com

« I'm hoping some of these "annoynaces" in xPages gets fixed in 8.5.1 | Main| This is why LOTUS DOCUMENTATION CHAPS MY .... or Will the real XPages Themes stand up? »

Calling XPages Gurus (CSS Question)

Category
0
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

Gravatar Image6 - Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.

Gravatar Image5 - Pay no attention to what the critics say... Remember, a statue has never been set up in honor of a critic!

Gravatar Image4 - Your first appearance, he said to me, is the gauge by which you will be measured; try to manage that you may go beyond yourself in after times, but beware of ever doing less.

Gravatar Image3 - Your first appearance, he said to me, is the gauge by which you will be measured; try to manage that you may go beyond yourself in after times, but beware of ever doing less.

Gravatar Image2 - @1 ... I haven't moved it to a theme mostly because I haven't gotten that far in my xpages discovery :)

.. 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.

Gravatar Image1 - Why not move the common css to a theme, there they will load before any defined in an xpage or custom control.

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.

Post A Comment