When I hover my subalbum gallerytitle there is no popup like the rest of my albums/photos, here is my gallerytitle:
[code]
" title="">Index
|
[/code]
A small example how the gallerytitle is build up right now:
Index | 2009 | Amsterdam (EHAM) | US Airways - N941UW
When I hover index I see: Return to index.
When I hover 2009 I see nothing.
When I hover Amsterdam (EHAM) I see: Return to album tumbnails.
My Question: How can I insert the title= so I can see the hover on 2009.
I tried something with the printParentBreadcrumb but without succes.
TIA
You are actually talking about the album title. In Zenphoto terms the "gallery title" is the name of your whole Zenphoto installation.
The hover (actually a tooltip) should show an excerpt of the description of the album. If there is none it shows nothing. You can't add that without hacking the functions which we naturally don't recommend.
Sure,
A real obvious example is here:
http://share.gospelriver.com/Music/Array-Hymn/
Mouse over "Music" in the nav and you will see what I mean.
I see. For anyone with the same issue, I changed the following block as follows in printParentBreadcrumb method in /zp-core/template-functions.php -- of course this will have to be saved and redone again after an upgrade. If there's a better way please let me know.
foreach($parents as $parent) { if ($i > 0) echo $between; $url = rewrite_path("/" . pathurlencode($parent->name) . "/", "/index.php?album=" . pathurlencode($parent->name)); $desc = $parent->getDesc(); $desc = strip_tags($desc); $replaceThese = array("&"," "," "," "); $desc = str_ireplace($replaceThese," ",$desc); $desc = substr($desc, 0, 25)."..."; if (!empty($desc) && $truncate) $desc = truncate_string($string, $length, $elipsis); printLink($url, $parent->getTitle(), $desc); $i++; }
The stript_tags should have been sufficient. THere then should have been no tags as those would have bees stripped by the function. Not sure why you are removing the ampersand. But if there are such in the description that are not already & then that is what they should be turned into.
Not sure on the truncate--did you pass true to that parameter or just leave it unspecified? If the latter, then of course truncate was not chosen.
Oh, I had the wrong order in my code. It should be like this:
foreach($parents as $parent) { if ($i > 0) echo $between; $url = rewrite_path("/" . pathurlencode($parent->name) . "/", "/index.php?album=" . pathurlencode($parent->name)); $desc = $parent->getDesc(); $replaceThese = array(" "," "," "); $desc = str_ireplace($replaceThese," ",$desc); $desc = str_ireplace("&","&",$desc); $desc = strip_tags($desc); $desc = substr($desc, 0, 25)."..."; if (!empty($desc) && $truncate) $desc = truncate_string($string, $length, $elipsis); printLink($url, $parent->getTitle(), $desc); $i++; }
This way, line breaks are replaced with spaces before de-tagging. If you just remove the tags, words after a line break are put up against the previous word with no space.
You're right about & - I changed that to & instead. Otherwise it was displaying as & even though in the description it is & (but not in the html of course).
I didn't try to figure out how to pass true to the parameter... and I only wanted to modify that one function. I assuming I would have to modify more code to do what you mention.
You're right, reviewing my code, it replaced my & amp; with & above. I was changing from the html coded amp to the string amp. So the line should I think be (without the space after &)
$desc = str_ireplace("& amp;","&",$desc);
Yes, I wondered where the $length variable came from. What you wrote makes more sense. I was confused because a search of my template-functions file yields only one location of $length (in that line) so I'm still uncertain how it is supposed to get that value. Did you forget the $elipsis='...' parameter in your modified declaration?
... also just notice now that the $replaceThese is displaying wrong. It changed every break to the same thing when it should be three different versions. I think the "code" functionality on this forum needs some work But I guess that is likely by design to clean up the code.
$replaceThese = array("","","");
Thanks for the update. I have used a preg_replace to get past the issue of the spaces.
In PHP, if a parameter has a default ($elipsis='...') you can omit the parameter and it will take on its default. Of course the rub is that you cannot omit intermediate parameters. Generally we have used a default of NULL for default parameters and have code in the body to set them to default if NULL is passed. Makes omitting parameters a little easier, but for some reason that was not done in this function.
The original function has it included I think?
function printParentBreadcrumb($before = '', $between=' | ', $after = ' | ', $truncate=NULL, $elipsis='...') {
So now that I understand the php default terminology your function makes sense.
This wasn't meant to be an analysis of the function, and obviously I don't know much about php, but I'm not sure where the $string variable in the original function comes from either...
if (!empty($desc) && $truncate) $desc = truncate_string($string, $length, $elipsis);
I'm good to go on this. Thanks again.