我正在使用alfresco 4.2c并且在过去的几天里我真的试图创建一个网站页面(例如日历,Disscussions等),这是“知识库”并用少量的dashlets进行渲染。我跟着露天3.4 (http://docs.alfresco.com/3.4/index.jsp?topic=%2Fcom.alfresco.Enterprise_3_4_0.doc%2Fconcepts%2Fsite-component-add.html) 用于创建页面站点的文档并正确遵循说明。 但是在创建页面网站并将其添加到网站后,当我单击特定选项卡(导航栏上的链接)时,它仅显示特定知识库网站页面的页眉部分和页脚部分
scope ='template'不呈现:(
所有编码与上述链接中提到的代码相同。
knowledgebase.get.desc.xml
<webscript>
<shortname>Knowledge Base</shortname>
<description>A summary of all Knowledge Base articles</description>
<family>site-dashlet</family>
<url>/components/knowledgebase</url>
</webscript>
knowledgebase.get.html.ftl
<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><ahref="${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>
org.alfresco.knowledgebase.ftl
<#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>
</@>`
我实施了
template.knowledgebase.knowledgebasexml
template.navigation.knowledgebasexml,
template.title.knowledgebasexml和
template.toolbar.knowledgebasexml
文件中提到的文件......
但知识库网站页面没有按预期呈现,它只输出页眉和页脚。它不输出导航栏,我在模板文件中提到的小面板
请帮助克服这个问题。任何支持,非常感谢:)
答案 0 :(得分:1)
我认为你的模板实例不正确。这是我创建的模板实例,效果很好:
<?xml version='1.0' encoding='UTF-8'?>
<template-instance>
<template-type>com/ciber/create-groups</template-type>
<description>Create Groups page</description>
<properties>
<pageFamily>site-members</pageFamily>
</properties>
<components>
<!-- Title -->
<component>
<region-id>title</region-id>
<url>/components/title/collaboration-title</url>
</component>
<!-- Navigation -->
<component>
<region-id>navigation</region-id>
<url>/components/navigation/collaboration-navigation</url>
</component>
<!-- Members Bar -->
<component>
<region-id>membersbar</region-id>
<url>/components/invite/members-bar</url>
</component>
<!-- Groups List -->
<component>
<region-id>create-groups</region-id>
<url>/components/create-groups</url>
</component>
</components>
</template-instance>
为了您的信息,您使用属性<@region>
定义的模板未填充相应的组件
答案 1 :(得分:0)
非常感谢Tahir Malik,你的方法是正确的。我的方法中的问题是我错误地提到了组件模板的<source-id>
。source-id
应该是指模板实例。
以下是导航组件的更正后的template.navigation.knowledge.xml
<?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>