can i make my omega menu (in sidebar) site specific?
I want to show in page 1 two different menuitems than in page 2.
Example
sidebar.xhtml:
Code: Select all
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsf="http://xmlns.jcp.org/jsf"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:po="http://primefaces.org/omega">
<div class="sidebar">
<div class="nano">
<div class="nano-content sidebar-scroll-content">
<div class="logo">
<p:graphicImage name="logo.png" library="images" width="113"/>
</div>
<div class="profile">
<p:graphicImage name="images/profile.png" library="omega-layout" />
<a id="profile-button" href="#">
<span class="username">#{sessionBean.vorname} #{sessionBean.name}</span>
<i class="fa fa-fw fa-bars"></i>
</a>
<ul>
<li><a href="#{request.contextPath}/pages/home.xhtml"><i class="fa fa-fw fa-sliders"></i><span>Home</span></a></li>
<li><a href="#{request.contextPath}/pages/page1.xhtml"><i class="fa fa-fw fa-bell"></i><span>Page 1</span></a></li>
<li><a href="#{request.contextPath}/pages/page2.xhtml"><i class="fa fa-fw fa-home"></i><span>Page 2</span></a></li>
</h:form>
</ul>
</div>
<div class="menu">
<ui:insert name="metaMenu"/>
</div>
</div>
</div>
</div>
</ui:composition>
Code: Select all
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
</f:facet>
<title>Title</title>
<h:outputScript name="js/nanoscroller.js" library="omega-layout" />
<h:outputScript name="js/layout.js" library="omega-layout" />
<h:outputScript name="calendar/de.js" library="js" />
<ui:insert name="head"/>
</h:head>
<h:body styleClass="main-body">
<div class="wrapper">
<ui:include src="topbar.xhtml" />
<ui:include src="sidebar.xhtml" />
<div class="main">
<ui:insert name="content"/>
</div>
<!--<ui:include src="footer.xhtml" />-->
</div>
<p:ajaxStatus style="width:32px;height:32px;position:fixed;right:7px;bottom:7px">
<f:facet name="start">
<p:graphicImage name="images/preloader.gif" library="omega-layout" style="width: 32px;"/>
</f:facet>
<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
<h:outputStylesheet name="css/animate.css" library="omega-layout" />
<h:outputStylesheet name="css/nanoscroller.css" library="omega-layout" />
<h:outputStylesheet name="css/layout.css" library="omega-layout" />
<h:outputStylesheet name="Omega_Overwrite.css" library="css" />
<h:outputStylesheet name="Omega_Zusatz_SE.css" library="css" />
<h:outputStylesheet name="Omega_Zusatz_AM.css" library="css" />
</h:body>
</html>
Code: Select all
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:po="http://primefaces.org/omega"
template="../templateomega/template.xhtml">
<ui:define name="metaMenu">
<po:menu>
<p:menuitem id="om_dashboard_1_1" value="Page 1-1" icon="fa fa-home" outcome="/pages/page1_1"/>
<p:menuitem id="om_dashboard_1_2" value="Page 1-2" icon="fa fa-home" outcome="/pages/page1_2"/>
</po:menu>
</ui:define>
<ui:define name="content">
<div class="ui-g">
<div class="ui-g-12">
<div class="card">
<h1><h:outputText value="Hallo #{sessionBean.vorname} #{sessionBean.name},"/></h1>
</div>
</div>
</div>
</ui:define>
</ui:composition>
Code: Select all
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:po="http://primefaces.org/omega"
template="../templateomega/template.xhtml">
<ui:define name="metaMenu">
<po:menu>
<p:menuitem id="om_dashboard_2_1" value="Page 2-1" icon="fa fa-home" outcome="/pages/page2_1"/>
<p:menuitem id="om_dashboard_2_2" value="Page 2-2" icon="fa fa-home" outcome="/pages/page2_2"/>
</po:menu>
</ui:define>
<ui:define name="content">
<div class="ui-g">
<div class="ui-g-12">
<div class="card">
<h1><h:outputText value="Hallo #{sessionBean.vorname} #{sessionBean.name},"/></h1>
</div>
</div>
</div>
</ui:define>
</ui:composition>
actually, it doesnt work.
the profile menu doesnt work too.