When I hover my subalbum gallerytitle there is no popup like the rest of my albums/photos, here is my gallerytitle:
[code]
<div id="gallerytitle">
<h3>
" title="<?php echo gettext('Return to index'); ?>">Index
| <?php printParentBreadcrumb("", " | "); printAlbumBreadcrumb("", " | "); ?>
<?php printImageTitle(true); ?></h3>
</div>
[/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
Comments
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.
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.
`
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++;
}
`
`if (!empty($desc) && $truncate) $desc = truncate_string($string, $length, $elipsis);` doesn't appear to function for me, but I truncated the desc beforehand instead.
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.
`
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 about & amp; - I changed that to & instead. Otherwise it was displaying as & amp; even though in the description it is & (but not in the html of course).
But that will not work without also changing the line in the function to
`if (!empty($desc) && $truncate) $desc = truncate_string($desc , $truncate, $elipsis);`
So unfortunately I am not clear on what you did. Did you change & amp; into &? or the other way around?
`$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("<b r />","<b r/>","<b r>");
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.
`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.