Announcement Announcement Module
Collapse
No announcement yet.
Can i use css in a portlet application to render page to have my own look & feel Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can i use css in a portlet application to render page to have my own look & feel

    HI,

    I've developed a portlet application wherein the jsp i'm rendering after successful login uses reference to some css (cascading style sheet) file. Basically i use this css file to have my own customized look and feel for the web pages.

    UNfortunately, my jsps are unable to locate that file .... or somehow they are not referencing the css file at all. THe content of my jsp displayed as plain html file. NO menus, no divisions nothing.

    Can somebody help in fixing this issue? IT will be a great help to me.

    Any help in this regard is highly appreciated.

    THank you.

  • #2
    External CSS files are referenced from the HEAD section of a HTML page. The content of the HEAD section will be generated by the portal, not by your portlet. The portlet only generates a HTML fragment, which when combined with the HTML fragments generated by other portlets on the portal page, and any HTML generated by the portal (such as the HEAD section) it will form the complete HTML page delivered back to the user.

    How you customize the HTML generated by the portal for a particular page is a portal specific question and should be directed to the support associated with your portal. Most likely you will need to create your own theme which controls the look and feel of the page generated by the portal.

    Chris

    Comment


    • #3
      Hi Laxmiraghu,

      I was wondering if you were able to get your external css integrated with your portal so that the styles appear in your portlet. If so, do you mind sharing how you did it? I greatly appreciate your help.

      Thanks!

      Comment


      • #4
        HI Anicad,

        I copied my application specific css file into the following directory where Jetspeed-2.1.3 is the directory where jetspeed is installed.

        Code:
        Jetspeed-2.1.3/webapps/jetspeed/decorations/portlet/jetspeed/css
        Then in my jsps (basically view), i referred it in the head section like below:

        Code:
        <link href="/jetspeed/decorations/portlet/jetspeed/css/default.css" media="screen, projection" rel="stylesheet" type="text/css" />
        Hope this info helps.

        Comment


        • #5
          Then in my jsps (basically view), i referred it in the head section like below:
          I hope you mean the portal jsps and not the PORTLET jsps. Portlet JSPs should only contain an HTML fragment for the section of the page that the portlet is responsible for rendering. The Portal page should contain the overall page structure and branding such as html/head/body tags.

          Comment


          • #6
            HI Chris,

            Actually what you said should be the right way to do it.

            Since i couldn't get thro' with it, i did the following:

            Create a file called header.jsp which has info upto <body> tag. Within this header.jsp, i've provided a link to my application specific css file.

            Then have another jsp called footer.jsp which has page footer information and closing of </body> and </HTML> tags.

            By doing this, i don't find any difference in layouts and my css styles are applied to all portlets even the jetspeed specific ones.

            Hope i can do this way ..... Please correct me if i'm wrong.

            Thanks again.

            Comment


            • #7
              Provided that header.jsp and footer.jsp are not included by the PORTLET then this sounds like a pretty standard approach. They should be included from somewhere portal specific.

              Comment

              Working...
              X