cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain CSS files for Portal Theme in Portal Component

Former Member
0 Kudos

Hello,

I need to integrate the CSS stylesheets of the portal theme in my Portal Component as I want to reuse the style classes in my JSPs. Does anybody know how I can obtain the links to the CSS files?

Thanks and best regards,

dominik

Accepted Solutions (1)

Accepted Solutions (1)

former_member182598
Active Contributor
0 Kudos

Hi Dominik,

Do you really need to access the css file explicitly? If you are running the jsp in portal, it should automatically pick the css file related with current theme.

Incase you are running the JSP outside portal the iView should send the parameter sap-cssurl which contains the complete URL to the portal theme in use: http://portal:port/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/themeName.

Thanks

Prashant

Former Member
0 Kudos

Hello,

thanks for the replys. Anyway, I need to find a way to check which Theme ist active for the current user, as I need to include some own stylesheets based on the current theme. I thought about an API which gives me all the informations about the current theme. Any idea?

Thanks and best regards,

Dominik

Former Member
0 Kudos

Hello Dominik..

It seems that you are using two or more themes in your portal...

And under some conditions/scenarios a certain theme gets displayed....

i.e. if (condition =1)...then theme1

or if (condition =2) ...then theme2

Can you tell us these conditions...!!

because i think you should try to catch these conditions in your code....and not the activated theme...

your activated theme is a result of some condition which you have already configured somewhere in your MainRule section...or elsewhere....

It is certain from your question that you have a scenario where logged in user can have different portal themes.....

and you need to modify application level theme based on portal level theme.....

If you can find some Theme API to check current theme...then it will be perfect for you...but if not then try to catch the condition as described above....

former_member182598
Active Contributor
0 Kudos

HI Dominik,

You can get a handle of the current theme and associated API by this

ILAFService iLAFService = (ILAFService)PortalRuntime.getRuntimeResources().getService("com.sap.portal.themes.lafservice.laf");

String themeRoot = iLAFService.getThemeRootURLPath(request, ILAFService.PORTAL_THEME);

String currentTheme = iLAFService.getCurrentTheme(request).getThemeName();

ILAFService has got some methods through which you can access current theme objets.

Thanks

Prashant

Former Member
0 Kudos

Hi,

I think the API described by Prashant will solve my problem. I will try it out as soon as possible.

Thank you guys!!!

Best regards,

dominik

Answers (1)

Answers (1)

Former Member
0 Kudos

Step 1 - Login

First things first you need to login to your SAP portal as the Portal administrator with system administration rights.

Step 2 - Navigate to export page

Go to 'System Administration' tab and select the 'Portal Display' sub tab. Now ensure the Theme Transport option is selected and you should see a list of themes available to export.

Step 3 - Export / download SAP portal theme

Now simply click on the theme you want to export (i.e. MyTheme), click save on the popup, choose a destination to save it too. A zip file should now have been created containing the files associated with creating that specific theme.

Step 4 - Next step is to un-zip this file, and the folders within it. You can now start having a look at the html, css and image files.

Edited by: Saurabh Agarwal on May 24, 2011 3:57 PM