Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tiles and variable CSS files

 
Jeff Horan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to drop my dependency on tables for layout and move to CSS. I have a struts project using modules and would like to tie a CSS file to each module. So, i have my tiles classicLayout.jsp template and tiles-def.xml definitions and have to use a different classicLayout(1-4) for every module because I can't figure out how to use one layout template and multiple definitions by passing in a CSS file name on an insert. The reason is because the file name has to be rewritten for url encoding:



I want to be able to add to my Layout page something like the following:



and be able to declare the "cssFile" by an insert tag.

Has anyone solved this problem before?
 
Jeff Horan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not <insert>. I meant <put> tag.
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, guess i solved it.. but took me some time... :-)

from tiles.def:


from the jsp:



from the jspf which renders the header:



that should solve your problem,

:-)

jan
[ October 17, 2006: Message edited by: Jan Groth ]
 
Jeff Horan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

I'm not familiar with the @import label. I'm assuming j2se5, right? I'm not able to find documentation on it, mostly because google doesn't include the '@' in the search. How does the url rewrite occur? You are using a simple html <style> tag and there is no implicit struts based url rewriting going on.
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wrong. no java 5, simple css import command for styles.

check here, or google on how to import external style files
http://www.topxml.com/css/css_rule_import.asp

i dont understand your concern about url-rewriting. we are just referencing a style file, and are using tiles to switch declarativly between differnt files. no need to worry about the session.

please feel free to post further questions,
jan
[ October 18, 2006: Message edited by: Jan Groth ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic