This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 26, 2012, 6:26 PM
135 Posts

Can I compute <resource> (CSS) in theme?

  • Category: Styles and Themes
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags: theme,resource,css
  • Replies: 2
Hi,
 
I'd like to use a customer specific CSS file (rendered= does not fit very well to this need). Neither of these work: 
 
<resource>
   <content-type>text/css</content-type>
   <href>#{javascript:"test.css"}</href>
</resource>
 
<resource>
   <content-type>text/css</content-type>
   <href><value>#{javascript:"test.css"}</value></href>
</resource>
 
I know I can compute the css on the XPage/Custom Control but can I do it in theme level? 
 
thanks, 
 
- Panu 
 
 
Jun 26, 2012, 6:55 PM
10 Posts
Re: Can I compute <resource> (CSS) in theme?
You can use rendered to compute whether a resource is used or not. Here are some examples:

<resource rendered="#{javascript:context.getUserAgent().getUserAgent().match("iPhone")}">
      <content-type>text/css</content-type>
      <href>iPhone.css</href>
 </resource>

<resource rendered="#{javascript:context.getUserAgent().isIE(0,6) == true}"> 
      <content-type>text/css</content-type>
      <href>ie6.css</href>
 </resource>
 
So, using the rendered property you can control when to load a specific resource. Does that answer your question? 
Jun 26, 2012, 7:17 PM
135 Posts
Re: Can I compute <resource> (CSS) in theme?
Hi,
 
I would not like to code all CSS file names to the theme. There is one CSS file for each customer and new ones are coming in all the time as new customers are added. That's why I'd prefer not to use the rendered property.
 
- Panu

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal