Re: CSS include order

2013-10-24 Thread Martin Grigorov
Hi,

1) You can use FilteredHeaderItem to group the site-wide CSS in the
beginning of the body, for example.
2) You can use PriorityHeaderItem to put component ones at the top
3) You can use custom header item comparator to re-order them on your
custom criteria

See http://wicketinaction.com/2012/07/wicket-6-resource-management/ for
explanation of all of those approaches.


On Wed, Oct 23, 2013 at 6:34 PM, Nick Pratt nbpr...@gmail.com wrote:

 Is there a quick/simple way to ensure that our site-wide CSS is included
 last (as included in our BasePage.html head section), after all other
 Components have contributed their CSS files?

 N



Re: CSS include order

2013-10-24 Thread Nick Pratt
Thanks Martin.

I figured out a slightly simpler approach (which I think works, please
correct me if Im mistaken) - I added the site-wide CSS to my BasePage in
Java rather than a simple include ref in the markup :

@Override
public void renderHead( IHeaderResponse response )
 {
super.renderHead( response );
 response.render( CssReferenceHeaderItem.forUrl( assets/css/global.css )
);
}

This results in the global.css being appended last in the head and thus
allows us to override anything provided by any Component or Behavior used
on the Page.


On Thu, Oct 24, 2013 at 3:33 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 1) You can use FilteredHeaderItem to group the site-wide CSS in the
 beginning of the body, for example.
 2) You can use PriorityHeaderItem to put component ones at the top
 3) You can use custom header item comparator to re-order them on your
 custom criteria

 See http://wicketinaction.com/2012/07/wicket-6-resource-management/ for
 explanation of all of those approaches.


 On Wed, Oct 23, 2013 at 6:34 PM, Nick Pratt nbpr...@gmail.com wrote:

  Is there a quick/simple way to ensure that our site-wide CSS is included
  last (as included in our BasePage.html head section), after all other
  Components have contributed their CSS files?
 
  N
 



Re: CSS include order

2013-10-24 Thread Martin Grigorov
On Thu, Oct 24, 2013 at 4:00 PM, Nick Pratt nbpr...@gmail.com wrote:

 Thanks Martin.

 I figured out a slightly simpler approach (which I think works, please
 correct me if Im mistaken) - I added the site-wide CSS to my BasePage in
 Java rather than a simple include ref in the markup :

 @Override
 public void renderHead( IHeaderResponse response )
  {
 super.renderHead( response );
  response.render( CssReferenceHeaderItem.forUrl( assets/css/global.css )


Use CssHeaderItem instead.
The behavior is the same, just the semantic is more clear.


 );
 }

 This results in the global.css being appended last in the head and thus
 allows us to override anything provided by any Component or Behavior used
 on the Page.


Yes. This is yet another way to do it.




 On Thu, Oct 24, 2013 at 3:33 AM, Martin Grigorov mgrigo...@apache.org
 wrote:

  Hi,
 
  1) You can use FilteredHeaderItem to group the site-wide CSS in the
  beginning of the body, for example.
  2) You can use PriorityHeaderItem to put component ones at the top
  3) You can use custom header item comparator to re-order them on your
  custom criteria
 
  See http://wicketinaction.com/2012/07/wicket-6-resource-management/ for
  explanation of all of those approaches.
 
 
  On Wed, Oct 23, 2013 at 6:34 PM, Nick Pratt nbpr...@gmail.com wrote:
 
   Is there a quick/simple way to ensure that our site-wide CSS is
 included
   last (as included in our BasePage.html head section), after all other
   Components have contributed their CSS files?
  
   N