Hide or display the topmenu by counting the elements!

Steeve LE PROVOST <[email protected]> Wed, 17 Dec 2008 13:29:44 +0100
Newsgroups gmane.comp.cms.jahia.template
Message-ID <A067E5F1F9EA9C4DBF211E41795A5FC99752F95164@GVAEXCHVS02.europe.firmenich.com>
--===============1344376151==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_A067E5F1F9EA9C4DBF211E41795A5FC99752F95164GVAEXCHVS02eu_"

--_000_A067E5F1F9EA9C4DBF211E41795A5FC99752F95164GVAEXCHVS02eu_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello everybody,

I would like to hide all the top menu when I have less than 2 menus...

For example, when we have more than 2 menus, we will display the "topmenu.i=
nc":

*         Master Page 1

o   SubPage 1

o   SubPage 2

o   SubPage 3

o   ...

*         Master Page 2

o   SubPage 1

o   SubPage 2

o   SubPage 3

o   ...

However, when we have only 1 menu we hide the "topmenu.inc": (Because we wi=
ll have all the sub pages at the left part of the website)

*         Master Page 1

o   SubPage 1

o   SubPage 2

o   SubPage 3

o   ...

Do you have an idea of how can I do this? I think I have to change somethin=
g in topmenu.inc to have another conditional test.
// top menu generation
if (topNavigationContainerList !=3D null) {........................}
topNavigationContainerVector.size

Thanks a lot for your help.

Steeve Le Provost

**********************************************************************
DISCLAIMER
This email and any files transmitted with it, including replies and
forwarded copies (which may contain alterations) subsequently
transmitted from Firmenich, are confidential and solely for the use
of the intended recipient.
The contents do not represent the opinion of Firmenich except
to the extent that it relates to their official business.
**********************************************************************=20

--_000_A067E5F1F9EA9C4DBF211E41795A5FC99752F95164GVAEXCHVS02eu_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:36.0pt;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
span.EmailStyle18
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:606160595;
	mso-list-type:hybrid;
	mso-list-template-ids:2098227032 67698689 67698691 67698693 67698689 67698=
691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Symbol;}
@list l0:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Courier New";}
@list l0:level3
	{mso-level-tab-stop:108.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level4
	{mso-level-tab-stop:144.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level5
	{mso-level-tab-stop:180.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level6
	{mso-level-tab-stop:216.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level7
	{mso-level-tab-stop:252.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level8
	{mso-level-tab-stop:288.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l0:level9
	{mso-level-tab-stop:324.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>Hello everybody,<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I would like to hide all the top menu when I have less=
 than
2 menus&#8230;<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><b>For example, when we have more than 2 menus, we will
display the &#8220;topmenu.inc&#8221;:<o:p></o:p></b></p>

<p class=3DMsoListParagraph style=3D'text-indent:-18.0pt;mso-list:l0 level1=
 lfo2'><![if !supportLists]><span
style=3D'font-family:Symbol;color:red'><span style=3D'mso-list:Ignore'>&mid=
dot;<span
style=3D'font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:red'>Master Page 1<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>SubPage 1<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>SubPage 2<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>SubPage 3<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>&#8230;<o:p></=
o:p></span></p>

<p class=3DMsoListParagraph style=3D'text-indent:-18.0pt;mso-list:l0 level1=
 lfo2'><![if !supportLists]><span
style=3D'font-family:Symbol;color:red'><span style=3D'mso-list:Ignore'>&mid=
dot;<span
style=3D'font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:red'>Master Page 2<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>SubPage 1<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>SubPage 2<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>SubPage 3<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>&#8230;<o:p></=
o:p></span></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><b>However, when we have only 1 menu we hide the
&#8220;topmenu.inc&#8221;: (Because we will have all the sub pages at the l=
eft part of the
website)<o:p></o:p></b></p>

<p class=3DMsoListParagraph style=3D'text-indent:-18.0pt;mso-list:l0 level1=
 lfo2'><![if !supportLists]><span
style=3D'font-family:Symbol;color:red'><span style=3D'mso-list:Ignore'>&mid=
dot;<span
style=3D'font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:red'>Master Page 1<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>SubPage 1<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>SubPage 2<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>SubPage 3<o:p>=
</o:p></span></p>

<p class=3DMsoListParagraph style=3D'margin-left:72.0pt;text-indent:-18.0pt;
mso-list:l0 level2 lfo2'><![if !supportLists]><span style=3D'font-family:"C=
ourier New";
color:#0070C0'><span style=3D'mso-list:Ignore'>o<span style=3D'font:7.0pt "=
Times New Roman"'>&nbsp;&nbsp;
</span></span></span><![endif]><span style=3D'color:#0070C0'>&#8230;<o:p></=
o:p></span></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Do you have an idea of how can I do this? I think I ha=
ve to
change something in <b>topmenu.inc</b> to have another conditional test.<o:=
p></o:p></p>

<p class=3DMsoNormal><span style=3D'font-size:9.0pt;font-family:"Courier Ne=
w"'>//
top menu generation<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:9.0pt;font-family:"Courier Ne=
w"'>if
(topNavigationContainerList !=3D null) {&#8230;&#8230;&#8230;&#8230;&#8230;=
&#8230;&#8230;&#8230;}<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:9.0pt;font-family:"Courier Ne=
w"'>topNavigationContainerVector.size<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:9.0pt;font-family:"Courier Ne=
w"'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal>Thanks a lot for your help.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><b>Steeve Le Provost</b><b><span style=3D'font-size:10=
.0pt;
font-family:"Arial","sans-serif";color:#002060'><o:p></o:p></span></b></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

<pre>**********************************************************************
DISCLAIMER
This email and any files transmitted with it, including replies and
forwarded copies (which may contain alterations) subsequently
transmitted from Firmenich, are confidential and solely for the use
of the intended recipient.
The contents do not represent the opinion of Firmenich except
to the extent that it relates to their official business.
**********************************************************************=20
</pre></body>

</html>

--_000_A067E5F1F9EA9C4DBF211E41795A5FC99752F95164GVAEXCHVS02eu_--


--===============1344376151==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
template_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/template_list

--===============1344376151==--