3 Replies Latest reply on Jan 31, 2006 10:11 AM by roy.russo

    Portlet Title Not displayed

    luke.studley

      Cannot get the title on my CMSPortlet to display - just get a blank title bar for the portlet, though for the helloworld portlet the title is displayed. Anyone any ideas why a title might not be displayed?

      I am using the skeleton of the HelloWorld app to which I have added a CMSPortlet instance displaying my own content (and which is now working thanks to a couple of threads!!)

      Here are the 2 defs from portlet.xml

       <portlet>
       <portlet-name>HelloWorldPortlet</portlet-name>
       <portlet-class>org.jboss.portlet.hello.HelloWorldPortlet</portlet-class>
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
       </supports>
       <portlet-info>
       <title>HelloWorld Portlet</title>
       </portlet-info>
       </portlet>
       <portlet>
       <portlet-name>CMSPortlet</portlet-name>
       <portlet-class>org.jboss.portal.core.portlet.cms.CMSPortlet</portlet-class>
       <init-param>
       <description>Default path to index page.</description>
       <name>indexpage</name>
       <value>/qualifi/courses/stage1/Head Start 1/2.html</value>
       </init-param>
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
       </supports>
       <portlet-info>
       <title>Stage 1 - Module 1 - First Steps</title>
       </portlet-info>
       </portlet>
      
      


      Anyone else experience trouble?

      Portal 2.2.1 RC2, JBoss AS 4.0.3SP1, Derby 10.1.2.1


        • 1. Re: Portlet Title Not displayed

          Well, its good to hear things are working on Derby.

          Now, I'm assuming the content is displaying correctly. The CMSPortlet has this in it:



          String title = (file.getContent().getTitle() != null) ? file.getContent().getTitle() : file.getContent().getName();


          So it will display the title of the page, if exists, or show the name of the page. You can specify a title when you edit the content.

          • 2. Re: Portlet Title Not displayed
            lstudley

            How cool is that! I looked in the CMSPortlet source as well - must have missed it. I will try it out later.

            Although ... it looks like the title can only be specified from the content file here ... it might be good to allow the CMSPortlet the option to override the title and display the one from the portlet.xml in preference to any set up for content in CMS. My CMSPortlet is displaying some 40 'pages' of html for a training course - and I don't want to have to name each page individually - or have to tell editors to remember to name pages. For this use case I would like to just create the portlet instance and give it a title of "Course: Blah blah" or whatever. I can probably change the code myself - but it might be a useful feature to build in ...

            The whole Derby integration has not been too painful - thanks to hibernate for that I guess. Although I have been spotting a few errors and warnings that might be related to Derby in the logs - but they don't seem to be affecting functionality so far - so I'm saving them up for a rainy day ;-)

            • 3. Re: Portlet Title Not displayed

              Yes. I think that logic may work better. Use the title attribute in the repository, and if not use the one from the portlet.xml.

              I will create a task for it.