Hi gang.
Is it possible to print only the Sub pages and skip the main page.
What I am trying to do I am making a horizontal menu that has a page number 1 using PrintPageMenu with 0 sub allowed then it has printAlbumMenu after that it prints out PrintPageMenu and hopefully only the subs of page nr 1. But of course as it is not it prints the 1 menu item with the subs.
I will do a screenshot to hopefully illustrate a little better.
http://img.skitch.com/20091109-btjugr3qjhkr4i8d6j372123h7.jpghttp://img.skitch.com/20091109-qgsxbxgck18nawxeg56hfk625s.jpg
Comments
The page menu generally generates a nested html list. With the right CSS setup you probably get what you want, too.
`
<?php printPageMenu("","","current","current","current","ForsÃða","test"); ?><?php printAlbumMenu("list-top","","","current","","","");?><?php printPageMenu("list","","","","current","","2"); ?>
`
Menu can be seen here.
http://www.moment.is/
I do have a couple of questions.
First regarding the menu...
Would it be possible somehow to be able to click on a menu item again when it has been selected. For example the Gallery(gallerà in this case) when a user might want to click on it to go back to the gallery overview when in Single Image mode. As it is not Active menu items can not be clicked.
Second is a bit different.
Would it be possible in single image view to pass the image Title to a certain field in the contact form. By placing a link that maybe uses `printImageTitle` on Single Image page and sends it to the contact form. I hope I am clear on that one. A little screen-shot of 2 different browser windows to illustrate my point.
http://img.skitch.com/20091110-jin292iy22htrfc29d3ptc8ke7.jpg
Main(CSS)
-Sub(CSS)
-SubSub(CSS)
-SubSubSub(CSS)
$css_class:
$css_class_active:
$css_class1:
$css_class_active1:
$css_class2:
$css_class_active2:
As well if the Main item could stay "Current" if any of the Sub Objects for that particular item are "Current"
2. I would really like to avoid more parameters as there are already quite al lot. We could do this by automatic numbering the sublevels css . The problem is that would need to be set within the theme's css for all possible sublevels which are unlimited (I think we forgot to update the doc).
Probably passing an array would be the best option.
3. The main element to stay current is on the list.
I will put all on the list, maybe I manage to get to it for 1.2.7 but I can't promise.
With the contact form I have looked into some javascript and other options, I will put that on hold for now.
http://img.skitch.com/20091111-qxiw4anhxe52a6etb1q1wycam1.jpg
(White arrow is mouse pointer)
I have this local, I will upload this a little later to have a look.
So pretty much what the problem would be, is the the Master does not get current when a sub of a master is selected... as stated above and you have on your list.
and when mouse over a sub item it displays all sub levels if it self not just the first one, I cant really wrap my head around that one if that is indeed possible with current printPage and PrintAlbum using CSS only.
Currently I am doing it like this.
`
<?php printPageMenu("list","menut","current","submenu","SubActive","","4"); ?><?php printAlbumMenu("list","","menut","current","submenu","SubActive","","4",false); ?>
`
and the css
`
.menut {
font-family: arial, sans-serif;
height: 25px;
position:relative;
font-size:12px;
z-index:100;
background-color: #333333;
}
.menut ul li a, .menut ul li a:visited {
display:block;
text-decoration:none;
color:#CCC;
width:104px;
height:25px;
text-align:center;
color:#fff;
border:1px solid #fff;
background:#333333;
line-height:20px;
font-size:12px;
}
.menut ul {
padding:0;
margin:0;
list-style: none;
}
.menut ul li {
float:left;
position:relative;
}
.menut ul li ul {
display: none;
}
.menut ul li:hover a {color:#fff; background:#2580a2;
}
.menut ul li:hover ul {display:block; position:absolute; top:26px; left:0; width:105px;
}
.menut ul li:hover ul li a.hide {background:#2580a2; color:#fff;
}
.menut ul li:hover ul li:hover a.hide {background:#2580a2; color:#000;
}
.menut ul li:hover ul li ul {display: none;
}
.menut ul li:hover ul li a {display:block; background:#333333; color:#FFF;
}
.menut ul li:hover ul li a:hover {background:#2580a2; color:#FFF;
}
.menut ul li:hover ul li:hover ul {display:block; position:absolute; left:105px; top:0;
}
.menut ul li:hover ul li:hover ul.left {
left:-105px;
}
ul#menut li.current {
display:block;
text-decoration:none;
color:#CCC;
width:104px;
height:25px;
text-align:center;
color:#fff;
border:1px solid #fff;
background:#0020a2;
line-height:20px;
font-size:12px;
}
ul#menut li ul.submenu li.SubActive {
display:block;
text-decoration:none;
color:#CCC;
width:104px;
height:25px;
text-align:center;
color:#fff;
border:1px solid #fff;
background:#0020a2;
line-height:20px;
font-size:12px;
}
`
I wonder if it would be possible to use the way the menu is built up and just call the subsubsub menu for example.
See for example screenshot from CssEdit
http://img.skitch.com/20091111-ns93miew9icwch9mjsm666g1ig.jpg
There it shows how the style is for the SubSubSub menu and I wonder if it could be controlled somehting like
`
ul#menut li ul.submenu li ul.submenu li ul.submenu
`
For Example using
`
ul#menut li ul.submenu li ul.submenu li ul.submenu li.SubActive {
background:#FF0;
}
`
Changes the background color of the SubSubSub
The menu uses nested lists so generally it should be possible to address each if the have class or id. But of course the problem is to make this scalable to not have to setup dozens of classes/ids in case the sub levels grow (unless you know the depth).
http://www.olihar.com/ZenTest/
I am going to look a little bit more into the css later tonight locally, if I get anything interesting I might upload it.
Just to mention it, I just saw by mistake, if I get a 404 Error page, printAlbumMenu returns an error. You can check it out yourself on that test install.
This is the error.
`
Fatal error: Call to undefined function printalbummenu() in (PATH to folder)/ZenTest/themes/zenpage-default/topbar.php on line 2
`
Again, the topbar is just a php file like sidebar with the current code of.
`
<?php printPageMenu("list","menut","current","submenu","SubActive","","8"); ?><?php printAlbumMenu("list","","menut","current","submenu","SubActive","","8",false); ?>
`
http://www.olihar.com/ZenTest/
just try the Photographs and Portrait folder and all its sub folders in the menu. Well not like I will me using so many subs my self. So screen-shot how its made, really. I guess its possible to keep on forever. As far as I can see this is the easiest way to add drop down menu to ZenPhoto as it is now.
http://img.skitch.com/20091112-t368y4kgge1pdq1tsbjdsx6bra.jpg
Now there are basicly only 2 things to get this working as I had in mind, Master item to stay current when any sub level current below. Well on the point it could be nice that any item stays current if it has an item in a sub below itself that is current.
As well the current menu items ether master or sub to be click-able when current.
What do you recon Malte? about usage like this instead of sidebar and to try and work on these 2 factor I mention above to add to the system.
To make all elements clickable links should not be a problem, having all parent ones active probably a little more as involves a lot of checks I guess.
A detail I forgot: The current css class is now attached to the `` instead of the `` to get the default behaviour in marking the currently selected element in standard themes. You probably need to change that detail.
On the matter of passing the image name to a certain field in the contact form. Do you have any idea how that could be possible. Even if I had to hardcode something into the contact form for this one project.
We could later put an entry for that menu CSS on the extensions section maybe.
I am holding off cleaning up the CSS and header code for now.