cancel
Showing results for 
Search instead for 
Did you mean: 

custom site page does not render as expected !

bhashitha
Champ in-the-making
Champ in-the-making
Hi all,
Im using alfresco 4.2c and during the past few dayz i really tried to crete a site page(such as calender,Disscussions etc.) which is "Knowledge Base" and render that with few dashlets.I followed the alfresco 3.4
(http://docs.alfresco.com/3.4/index.jsp?topic=%2Fcom.alfresco.Enterprise_3_4_0.doc%2Fconcepts%2Fsite-...)
documentation for create the page site and followed the instructions properly.
But after creating the page site and add it into a site and when i click the particular tab(link which is at navigation bar) it displays only the header section and footer section for particular Knowledge Base site page

the scope='template' does not render Smiley Sad

All the codings are same as the codes which is mentioned at the above given link .

knowledgebase.get.desc.xml

<blockcode>
<webscript>
   <shortname>Knowledge Base</shortname>
   <description>A summary of all Knowledge Base articles</description>
   <family>site-dashlet</family>
   <url>/components/knowledgebase</url>
</webscript>
</blockcode>


knowledgebase.get.desc.xml

<blockcode>
<div class="dashlet knowledgebase">
   <div class="title">${msg("header.knowledgebase")}</div>
   <div class="body">
      <div class="msg">
<#if (error?exists)>
         <div>${msg("error.call")}</div>         
<#else>
         <table>
            <tr>
               <td>${msg("label.all")}:</td>
               <td>${all}</td>
            </tr>
            <tr>
               <td><a href="${url.context}/page/site/${page.url.templateArgs.site!""}/documentlibrary?filter=tag&filterData=draft#" class="theme-color-1">${msg("label.drafts")}</a>:</td>
               <td>${drafts}</td>
            </tr>
            <tr>
               <td><a href="${url.context}/page/site/${page.url.templateArgs.site!""}/documentlibrary?filter=tag&filterData=pending#" class="theme-color-1">${msg("label.pendingApprovals")}</a>:</td>
               <td>${pendingApprovals}</td>                  
            </tr>
            <tr>
               <td><a href="${url.context}/page/site/${page.url.templateArgs.site!""}/documentlibrary?filter=tag&filterData=current#" class="theme-color-1">${msg("label.current")}</a>:</td>
               <td>${current}</td>
            </td>
            <tr>
               <td><a href="${url.context}/page/site/${page.url.templateArgs.site!""}/documentlibrary?filter=tag&filterData=archived#" class="theme-color-1">${msg("label.archived")}</a>:</td>
               <td>${archived}</td>
            </td>
         </table>
</#if>
      </div>
   </div>
</div>
</blockcode>

org.alfresco.knowledgebase.ftl

<blockcode>
<#include "include/alfresco-template.ftl" />

<@templateHeader/>

<@templateBody>
   <div id="hd">
      <@region id="header" scope="global" protected=true />
      <@region id="title" scope="template" protected=true />
      <@region id="navigation" scope="template" protected=true />
   </div>
   <div id="bd">
      <div>
         <div id="yui-main">
            <div id="divknowledgebaseList">
               <@region id="knowledgebase" scope="template" />
            </div>
         </div>
      </div>
   </div>
</@>

<@templateFooter>
   <div id="ft">
      <@region id="footer" scope="global" protected=true />
   </div>
</@>
</blockcode>

and i have implemented the template.knowledgebase.knowledgebase.xml, template.navigation.knowledgebase.xml, template.title.knowledgebase.xml and template.toolbar.knowledgebase.xml files as exactly mentioned in the documentation…


but Knowledge Base site page doesnt render as expected and it only output header and the footer.It doesnt output navigation bar, dashlets that i have mentioned within the templates files


please help to overcome this problem.Any support, is really appreciated Smiley Happy



7 REPLIES 7

ddraper
World-Class Innovator
World-Class Innovator
When you have a "template" scoped region you need to ensure that you have configured the Components in your template XML file. If the Components don't exist then the Regions won't find anything to bind to.

bhashitha
Champ in-the-making
Champ in-the-making
@ddraper, I would  be thankful to u for giving me a fast reply Smiley Happy I have configured template.knowledgebase.knowledgebase.xml, template.navigation.knowledgebase.xml, template.title.knowledgebase.xml and template.toolbar.knowledgebase.xml files according to the instructions.is there any other configurations that i should do ? can u please give me further instructions if there any ..

ddraper
World-Class Innovator
World-Class Innovator
I've explained why you're not seeing anything rendered. If you paste your template configuration file into the thread then I'll be able to describe exactly why it's not working.

bhashitha
Champ in-the-making
Champ in-the-making
template.knowledgebase.knowledgebase.xml
<blockcode>
<?xml version='1.0' encoding='UTF-8'?>
<component>
   <scope>template</scope>
   <region-id>knowledgebase</region-id>
   <source-id>knowledgebase</source-id>
   <url>/components/knowledgebase</url>
   <properties>
      <maxResults>25</maxResults>
   </properties>
</component>
</blockcode>


template.navigation.knowledgebase.xml

<blockcode>
<?xml version='1.0' encoding='UTF-8'?>
<component>
   <scope>template</scope>
   <region-id>navigation</region-id>
   <source-id>knowledgebase</source-id>
   <url>/components/navigation/collaboration-navigation</url>
</component>
</blockcode>

template.title.knowledgebase.xml

<blockcode>
<?xml version='1.0' encoding='UTF-8'?>
<component>
   <scope>template</scope>
   <region-id>title</region-id>
   <source-id>knowledgebase</source-id>
   <url>/components/title/collaboration-title</url>
</component>
</blockcode>

template.toolbar.knowledgebase.xml
<blockcode>
<?xml version='1.0' encoding='UTF-8'?>
<component>
   <scope>template</scope>
   <region-id>toolbar</region-id>
   <source-id>knowledgebase</source-id>
   <url>/components/knowledgebase/collaboration-toolbar</url>

</component>
</blockcode>

ddraper
World-Class Innovator
World-Class Innovator
It's not possible to define template scoped Components by just adding "template" as the scope - a template scoped Component must be defined within the template XML configuration file. It would also have helped if you could have indicated where each of those files was placed as Surf looks up object configuration based on the path of the file (so if a Component XML file exists under the templates path then it will never be registered.

bhashitha
Champ in-the-making
Champ in-the-making
i placed my template xml files in /tomcat/shared/classes/alfresco/web-extension/site-data/components..I didnt get the point exactly yet. Rather than setting the scope as template, what are the other configuration and  files that I should generate to render the components within the template site(which is knowledge base).can u please explain descriptively.im looking foward for ur fast replies sir Smiley Happy

bhashitha
Champ in-the-making
Champ in-the-making
Found the Problem !.The problem in my approach was i have incorrectly mentioned the <blockcode><source-id></blockcode> for component templates.source-id should be refers to template instance.

Following is the corrected template.navigation.knowledge.xml for navigation component
<blockcode>
<?xml version='1.0' encoding='UTF-8'?>
<component>
<scope>template</scope>
<region-id>navigation</region-id>
<source-id>knowledgebase</source-id>
<url>/components/navigation/collaboration-navigation</url>
</component>


</blockcode>
Finally It is as like in documentation.Thankz ddraper for your assistant Smiley Happy