Pages (2): 1 2   
Member
Member
Michel   2009-12-20, 15:23
#1

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

Administrator
Administrator
acrylian   2009-12-20, 17:05
#2

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.

Member
Member
nbruley   2011-12-07, 19:27
#3

The Title text for printParentBreadcrumb() appears to include html formatting tags. Is there any way to get rid of those, as it looks unprofessional with etc all over in it. Thanks.

Administrator
Administrator
acrylian   2011-12-07, 19:56
#4

Could you please be more specific maybe?

Member
Member
nbruley   2011-12-07, 23:12
#5

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.

Member
Member
sbillard   2011-12-08, 00:09
#6

Sure, don't put html into titles. Probably you really meant that text as a description anyway.

Member
Member
nbruley   2011-12-08, 01:42
#7

Confused... All I have for a title is "Music" which is what shows up in the nav and what is coming up as the "title" of the link is what is contained in the description ...

Member
Member
sbillard   2011-12-08, 02:38
#8

Seems the breadcrump function will display the description if it exists. In that case the HTML tags need to be stripped.

Member
Member
nbruley   2011-12-08, 04:55
#9

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++; }

Member
Member
nbruley   2011-12-08, 04:58
#10

Edit: I don't know why
if (!empty($desc) && $truncate) $desc = truncate_string($string, $length, $elipsis); doesn't appear to function for me, but I truncated the desc beforehand instead.

Member
Member
sbillard   2011-12-08, 05:56
#11

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.

Member
Member
nbruley   2011-12-08, 22:57
#12

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.

Member
Member
nbruley   2011-12-09, 00:12
#13
  • edit: my post was changed due to processing the html. The ampersand part should be

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).

Member
Member
sbillard   2011-12-09, 00:13
#14

printParentBreadcrumb('', ' | ',' | ', )

But that will not work without also changing the line in the function to
if (!empty($desc) && $truncate) $desc = truncate_string($desc , $truncate, $elipsis);

Member
Member
nbruley   2011-12-09, 00:14
#15

Ah, now I get it. Thanks.

Member
Member
sbillard   2011-12-09, 02:05
#16

ARG, posting about ampersands is really confusing on this site!

So unfortunately I am not clear on what you did. Did you change & amp; into &? or the other way around?

Member
Member
nbruley   2011-12-09, 03:34
#17

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("","","");

Member
Member
sbillard   2011-12-09, 03:50
#18

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.

Member
Member
nbruley   2011-12-09, 03:59
#19

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.

Member
Member
sbillard   2011-12-09, 18:13
#20

The original code did not make any sense. The line I posted above should be correct. Anyway, all changes are in the nightly build now.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.