Using Custom CSS Elements
i want to add own elements into a theme css file and use it in a jsp file (part of a portal archive). So im wondering if this is possible and how this will affect the sap portal theme editor?
Roland Schroth replied
as I understand, you are changing code of the top level navigation par file too. Is that right?
Even if not you could deploy your own par file for your top level navigation and include your own css files with it. But that way you will of course not be able to edit these css properties in the theme editor.
But as far as I understand the documentation there is no (standard) way to change the theme editors behaviour or how it handles the css files that it generates.
With the following Code you can include css files with your par file:
<%@ page import = "com.sapportals.portal.prt.component.IPortalComponentRequest" %> <% IResource myCss = componentRequest.getResource(IResource.CSS, "css/my.css"); currentResponse.include(componentRequest, myCss); %>
The above used path is relative to the root folder in the par file. The css files should be located in the subfolder css.
I am using this way in my own project and it works well.