Bonjour à tous,
J'ai créer un template, mais il n'apparaît pas de menu à droite : je n'ai
pas "AJOUTER UNE PAGE" qui est affiché.
Dans le Montemplate.jsp j'appele le fichier du menu :
<div id="categories"><a name="menus"></a></div>
<div id="categories">MON TEMPLATE<br />
<%@ include file="include/Montemplate_menu1.jsp"%>
</div>
</div>
Ci join dans le mail : mon .jsp de mon menu.
---------------
Comment faire pour ajouter le menu?
Je vous remercie pour vos futures réponses.
Cordialement,
--
Assistante Webmaster
<%!
public void getPageSubTree( JahiaData jData,
int rootPageID,
int currentPageID,
Vector imageArray,
String theURL,
int currentLevel,
PageContext pageContext
)
throws JahiaException
{
JspWriter out = pageContext.getOut();
JahiaContainerList linksContainerList =
jData.containers().getAbsoluteContainerList( "linkContainerMontemplate",
currentPageID );
boolean editMode = jData.gui().isEditMode();
currentLevel++;
try {
if (linksContainerList != null) {
Enumeration linksContainerEnum = linksContainerList.getContainers();
while (linksContainerEnum.hasMoreElements()) {
JahiaContainer linksContainer = (JahiaContainer)
linksContainerEnum.nextElement();
JahiaPage link = (JahiaPage) linksContainer.getFieldObject(
"link" );
if (link != null) {
String state = "";
if ( jData.gui().isPageInPath(link.getID()) ) {
state = "on";
}
if ( link.getID() == rootPageID ) {
state = "current";
}
out.println("<tr><td class=\"left"+state+"tpl\"");
if (! jData.gui().isPageInPath(link.getID()) ){
}
if (!editMode){
out.println(" onclick=goTo('" +
link.getUrl(jData.params()) + "')");
}
out.println(">");
int truncSize = editMode ? 30 - (currentLevel * 3) : 40 -
(currentLevel * 3);
if (link.getID() == rootPageID) {
out.println("<span class=\"menulevel" + currentLevel
+"\">< ");
out.println(""+jData.gui().glueTitle(link.getTitle(),truncSize)+"</span>");
} else {
out.println("<span class=\"menulevel" + currentLevel
+"\">> <a class=\"tpl-menu2"+state+"\"");
out.println("\" href=\"" + link.getUrl(jData.params())
+ "\">"+jData.gui().glueTitle(link.getTitle(),truncSize)+"</a></span>");
}
// displays action buttons on container
ContainerBean linksContainerBean = new
ContainerBean(linksContainer,jData.params());
jData.gui().html().drawBeginActionMenu(linksContainerBean,
null, null, false, "", "unicetemplates.Unice2003", null, out);
// displays sub links
if (jData.gui().isPageInPath(link.getID())) {
Boolean theBoolean = new
Boolean(linksContainerEnum.hasMoreElements());
Vector childImageArray = (Vector) imageArray.clone();
childImageArray.addElement(theBoolean);
getPageSubTree(jData , rootPageID, link.getID(),
childImageArray, theURL,currentLevel, pageContext);
}
}
}
}
// displays action buttons on containerlist
if (linksContainerList != null) {
if ( (rootPageID == currentPageID) &&
(!jData.gui().html().drawAddContainerLauncher( linksContainerList ).equals(""))
) {
out.println("<br/>");
out.println("<span class=\"menulevel" + currentLevel +"\">");
ContainerListBean linksContainerListBean = new
ContainerListBean(linksContainerList,jData.params());
jData.gui().html().drawBeginActionMenu(linksContainerListBean ,
null, theURL + "/images/add.gif", false, "", "unicetemplates.Unice2003",
"addPage", out);
out.println("</span><br/>");
}
}
} catch (IOException ioe) {
//System.out.println("IO exception while trying to print left menu for
object ", ioe);
}
}
// return the pid of the parent page at the wanted level
public int getPageIDAtLevel(JahiaData jData, int startLevel, int maxLevel)
throws JahiaException
{
int initLevel = startLevel;
int currentLevel = jData.gui().getLevel();
if ( (currentLevel - maxLevel) > initLevel ){
startLevel = currentLevel - maxLevel;
}
Enumeration myPath =
jData.page().getContentPagePath(jData.params().getOperationMode(),
jData.params().getUser());
int i = 0;
while (myPath.hasMoreElements()) {
ContentPage myPage = (ContentPage) myPath.nextElement();
i++;
if (i == (startLevel)) {
return myPage.getID();
}
}
return -1;
} // end getLevelID
%>
<%
String maxLevelStr = (String) pageContext.findAttribute("leftMenuMaxDepth");
int maxLevel = 2;
try {
maxLevel = Integer.parseInt(maxLevelStr);
} catch (NumberFormatException nfe) {
}
int startLevel = jData.gui().getContentHomePage().getID() ==
jData.page().getID() ? 1 : 2;
int linkCount = 0;
if (!thePrint) {
%>
<content:declareContainerList name="linkContainerCompoLash"
title="linkContainerCompoLash"
titleKey="Link Container"
bundleKey="<%=resBundleID%>"
>
<content:declareContainer>
<content:declareField name="link"
title="Link"
titleKey="link"
bundleKey="<%=resBundleID%>"
type="Page"
/>
</content:declareContainer>
</content:declareContainerList>
<content:absoluteContainerList name="linkContainerMonTemplate"
id="linkContainerList" pageLevel="<%=String.valueOf(startLevel)%>">
<jahiaHtml:actionMenu name="linkContainerList" namePostFix=""
resourceBundle="unicetemplates.Unice2003">
<content:container id="linkContainerMontemplate">
<content:pageField valueId="link" name="link"/>
<logic:notEmpty name="link">
<bean:define id="state" value=""/>
<logic:equal name="link"
property="inCurrentPagePath" value="true">
<bean:define id="state" value="on"/>
</logic:equal>
<logic:equal name="link" property="currentPage"
value="true">
<bean:define id="state"
value="current"/>
</logic:equal>
<%
linkCount++;
if (linkCount == 1) {
%><table width=220 border=0
cellspacing=0 cellpadding=0><%
}
%>
<tr valign=top>
<td colspan=2 valign=top
class="tpl-menu1<bean:write name='state'/>"
<jahia:ifNotEditMode>
onclick="goTo('<bean:write name='link' property='url'/>')"
</jahia:ifNotEditMode>
align=left
bgcolor="white">
<logic:notEqual name="state"
value="current">
> <a
href="<bean:write name='link' property='url'/>" class="tpl-menu1<bean:write
name='state'/>"><bean:write name="link" property="title"
filter="false"/><logic:notPresent name="link"
property="title">null</logic:notPresent></a>
</logic:notEqual>
<logic:equal name="state"
value="current">
<
<a href="<bean:write
name='link' property='url'/>" class="tpl-menu1<bean:write
name='state'/>"><bean:write name="link" property="title"
filter="false"/><logic:notPresent name="link"
property="title">null</logic:notPresent></a>
</logic:equal>
<jahiaHtml:actionMenu
name="linkContainerMontemplate" namePostFix=""
resourceBundle="unicetemplates.Unice2003" useFieldSet="false">
</jahiaHtml:actionMenu>
<%
if ( jData.gui().getLevel() >
startLevel + maxLevel + 1){
%>
<logic:equal name="link"
property="inCurrentPagePath" value="true">
<br/><a
href="<%=jData.params().composePageUrl(getPageIDAtLevel(jData,startLevel + 1
,maxLevel))%>"><img src="<jahia:contextURL/>/images/up.gif" alt="[..]"
border="0" width="16" height="16"></a>
</logic:equal>
<%
}
%>
<logic:equal name="link"
property="inCurrentPagePath" value="true">
<%getPageSubTree(jData,
jData.page().getID(), getPageIDAtLevel(jData,startLevel + 1 ,maxLevel), new
Vector(), theURL,1, pageContext);%>
</logic:equal>
</td>
</tr>
</logic:notEmpty>
</content:container>
<%
if (linkCount > 0) {
%>
</table>
<%
}
hasLeft = linkCount;
%>
<content:addContainerURL id="addContainerURL" display="false"/>
<logic:present name="addContainerURL">
<a href="<bean:write
name='addContainerURL'/>"><%=addBoxButton%> <jahia:resourceBundle
resourceBundle="unicetemplates.Unice2003"
resourceName="addPage"/></a>
</logic:present>
</jahiaHtml:actionMenu>
</content:absoluteContainerList>
<%
}
if (jData.gui().isEditMode()) {
hasLeft++;
%><%
}
%>_______________________________________________
french_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/french_list