cancel
Showing results for 
Search instead for 
Did you mean: 

How to apply a custom style sheet to a site.

Former Member
0 Kudos

Hello,

How can I link a site (with all the web pages) to a pre-defined custom style sheet, so that the rendering is consistent across all web pages of the site. We are migrating from an external website to WPC site. Can I use the style sheet as it is from the external website and upload into KM Content.

Thanks

Srinivas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

if you put your css in the above mentioned folder it is always included in your page. You don't have to modify the jsp as well. Just use your styles directly.

However if you want to achieve consistent look and feel with your framework page you may consider making your style same like those in the framework page.

regards,

--epexpert

Former Member
0 Kudos

Hi epexpert,

I will restate my problem.

I have created custom page layout by changing the jsp and xml files. Now I want to use a custom style sheet.

I have uploaded my custom style sheet at "etc/wpceditor/css/runtime/myfile.CSS"

I don't know how to test if my page layout is using this style sheet (myfile.css). ???

How should I link my custom page layout to this style sheet (myfile.css) ?

I have also tried to include the myfile.css in my project (par) changed the jsp file


<%@ page import="com.sapportals.portal.prt.component.IPortalComponentResponse"%> 
<%@ page import="com.sapportals.portal.prt.resource.IResource"%>
<% IPortalComponentResponse componentResponse = 
		(IPortalComponentResponse)pageContext.getAttribute(javax.servlet.jsp.PageContext.RESPONSE);
	IResource myfile = componentRequest.getResource(IResource.CSS, "css/myfile.css"); 
	componentResponse.include(componentRequest, myfile); %>

Can you tell me how to test if am using the style sheet myfile.css ?

Thanks

Srinivas

vishal_gupta15
Contributor
0 Kudos

Hi

Instead of refering CSS by Resource, use the following code inthe head section of the JSP

<LINK REL="stylesheet" HREF="irj/go/km/docs/etc/wpceditor/css/runtime/File.css" />

And to check the which CSS page is using use the tool Internet Explorer Toolbar or Firebug.

_Vishal

Answers (1)

Answers (1)

vishal_gupta15
Contributor
0 Kudos

Hi Srinivas,

For WPC the default CSS is located in KM at etc/wpceditor/css/runtime/Yourfile.CSS

here Youfile is the name of the css file to be used

_Vishal

Former Member
0 Kudos

Hi Vishal,

Thanks for your quick response. I have uploaded the style sheet. How should I go about linking this custom style sheet to site content ( all the web pages) ?

Thanks

Srinivas

vishal_gupta15
Contributor
0 Kudos

Hi Srinivas,

The WPC page by default take the reference of CSS from /etc.../runtime/...css for the runtime enviornment.

and for the designtime they refer the css from /etc...../designtime/...css.

Hope this will solve your query.

_Vishal

Former Member
0 Kudos

Hi Vishal,

I see 3 other css files in the runtime folder "content.css", "sdn_apps.css" and "sdn_general.css". How should I verify that the new site content (with all web pages) is using my new ".css" style sheet ?

Are all the .css files (in the runtime folder) being used in the runtime ?

vishal_gupta15
Contributor
0 Kudos

Hi Srinivas,

In this case we can specify which css to used in the JSP file of the Layout you are using.

_Vishal