10 Replies Latest reply on Aug 11, 2010 5:03 AM by lyahyaoui

    Overriding UIPortalNavigation.gtmpl doesn't work

    lyahyaoui

      Hi ,

       

      I'm trying to add some Text inside the Navigation Portlet ,but it still not appear on the Page.

       

      My Steps:

       

      1- To modify the UIPortalNavigation.gtmpl located in web.war/groovy/portal/webui/component.

      2- To copy the UIPortalNavigation.gtmpl into webapp/templates/groovy/webui/component/UIPortalNavigation.gtmpl

      3- To redefine Preferences of the Navigationportlet in the portal.xml :

       

      <portlet-application>
                  <portlet>
                 <application-ref>web</application-ref>
                 <portlet-ref>MenuPortlet</portlet-ref>
                 <preferences>
                   <preference>
                     <name>template</name>
                     <value>system:/templates/groovy/webui/component/UIPortalNavigation.gtmpl</value>
                     <read-only>false</read-only>
                   </preference>
                 </preferences>
               </portlet>
                  <access-permissions>Everyone</access-permissions>
                  <show-info-bar>false</show-info-bar>
            <show-application-state>false</show-application-state>
            <show-application-mode>false</show-application-mode>

      </portlet-application>

       

      Is anything absent so that the Text appears in the  page?

       

      Ps: I change The UIFooterPortlet.gtmpl width the some Steps and it works.

        • 1. Re: Overriding UIPortalNavigation.gtmpl doesn't work
          hoang_to

          Where did you put the template UIPortalNavigation.gtmpl?

           

          Template of Navigation Portlet is retrieved from the PortletPreference and set programmatically. The path starts with system:/ means the template must be located under portal.war or any extension of classic portal

          • 2. Re: Overriding UIPortalNavigation.gtmpl doesn't work
            lyahyaoui

            Hi,

             

            I put  the UIPortalNavigation.gtmpl inside myPortal.war/templates/groovy/webui/component.

            I also put UIBannerPortlet.gtmpl inside this Directory and change it without Problem, but with UIPortalNavigation.gtmpl doesnt work.

            I also Tried to change the original UIPortalNavigation.gtmpl under deploy\gatein.ear\web.war\groovy\portal\webui\component without success,

            my changes still not appear.

             

            Thanks

            • 3. Re: Overriding UIPortalNavigation.gtmpl doesn't work
              trong.tran

              Too strange, it should take either old one or new one.

               

              After changing, did you clean up temp folders and database ? And make sure your myPortal.war is listed in the portal's dependencies declaration

              • 4. Re: Overriding UIPortalNavigation.gtmpl doesn't work
                hoang_to

                I remark that your <portlet-ref> is MenuPortlet. Could you show us the portlet definition of MenuPortlet in the portlet.xml?

                • 5. Re: Overriding UIPortalNavigation.gtmpl doesn't work
                  trong.tran

                  I remark that your <portlet-ref> is MenuPortlet

                  Ah yes. it makes sense.

                   

                  Lyahyaoui, keep <portlet-ref> as NavigationPortlet if you only want to overwrite UIPortalNavigation.gtmpl of the Navigation portlet,

                  • 6. Re: Overriding UIPortalNavigation.gtmpl doesn't work
                    lyahyaoui

                    Hi,

                     

                    I change the <portlet-ref>MenuPortlet</portlet-ref> to <portlet-ref>NavigationPortlet</portlet-ref> , and I can now display my changes in the

                    UIPortalNavigation.gtmpl on my Portalpage, but it's not the Solution for my Problem.

                    I thougth the MenuPortlet is the NavigationPortlet , so thats why i tried to override the UIPortalNavigation.gtmpl.

                     

                    If i want now to add some Text or divs inside the MenuPortlet ,which gtmpl-File must be changed?

                     

                    Best Regards

                    • 7. Re: Overriding UIPortalNavigation.gtmpl doesn't work
                      trong.tran

                      what is the MenuPortlet ? is it a your own portlet ?

                       

                      Actually, I'm not sure to understand what you are trying to do ?

                      • 8. Re: Overriding UIPortalNavigation.gtmpl doesn't work
                        lyahyaoui

                        Hi Trong,

                         

                        The MenuPortlet is my own Portlet, i was trying to override the NavigationPortlet with my own Portlet but it doesn't work.

                         

                        Now i just take the NavigationPortlet for the Links, but the Links doesn't appear:

                         

                        in the UIPortalNavigation.gtmpl  i got this code:

                         

                        <div class="UITab">
                                    <div class="$tabStyleNavigation">
                                     <div class="LeftTab">
                                     ....              

                         

                        <div>

                         

                        und with firebug i get another code :

                         

                        <div class="UITab" style="width: 149px; display: none;">

                         

                        I don't know how the element UITab takes this Styles(width:149px,display:none;) ?

                         

                        Under UITabSystem/UITabs/Stylesheets i have this Class:

                         

                        .UIHorizontalTabs .UITab {
                        float: left; /* orientation=lt */
                        float: right; /* orientation=rt */
                        font-weight: bold;
                        text-align: center;
                        width: 13.5em;
                        }

                         

                                  

                        Thanks

                        • 9. Re: Overriding UIPortalNavigation.gtmpl doesn't work
                          hoang_to

                          What do u mean by 'override Navigation portlet with your own MenuPortlet'?

                           

                          As you put MenuPortlet between the tag <portlet-ref>, the widget you could see in your web page is the portlet window associated with the porlet definition MenuPortlet (an element <portlet> in the file portlet.xml is called a portlet definition, mentioned in the spec 286). There 's nothing to see with NavigationPortlet here, and if you wish to customize your portlet window, you gotta handle the template of MenuPortlet

                          • 10. Re: Overriding UIPortalNavigation.gtmpl doesn't work
                            lyahyaoui

                            Hi Hoang,

                             

                            pls check my last Post ,i have another Problem right now.

                             

                            Thanks