I'm trying to add the following to my theme.tpl file to speed things up. It seems like $theme->navigator is not available in this scope, though, as my url gets filled with ...main.php (when I use .next) or an error like "array_keys(): The first argument should be an array rather than the image link...." (when I use ['next'])
<head>
...
<link rel="next" href="{g->url params=$theme.itemNavigator['next']}" title="Next image" />
<link rel="previous" href="{g->url params=$theme.itemNavigator['back']}" title="Previous image" />
</head>
Is the navigator actually initialized when theme.tpl is being parsed?
If so, what is the correct syntax to retrieve the image url? I guess this is php question more than a gallery question...
Posts: 808
Here is the code for a previous image
<a href="{g->url params=$theme.navigator.back.urlParams}" class="previous">Previous</a>
and the next
Posts: 11
thanks. That gives me the appropriate ".html" href (i.e., a link to the *page* that contains the next or previous image). I can't tell if the link-prefetching is working, though. Would it show up in server logs?
Do you know if there is a way to get just the .JPG url -- (i.e., a link to *image* itself?) from the navigator?
Posts: 808
I guess that would depend on which image size you want it to grab. if you turn on buffered debug mode you can see all the variables that you can use.
Posts: 11
I turned on buffered debug output, but don't see an obvious variables list. I searched for "navigator" and "urlparams" (two of the variables that I -know- exist), but didn't get anything useful: urlparams doesn't appear and the only references to naviagator are to the Navigator.tpl file.
Posts: 11
An update and request for generalization...
The variables list is in a (blocked) popup window, so I didn't notice it until recently. Looks like it doesn't contain what I want. The closest I can come so far to grabbing the JPG (not the html) is:
as you can see I've had to make assumptions about the server name, the id of the medium-sized photo (is it guaranteed to be next.item.id+1?), and the serial number (what's that for?). None of this shows up in the debug popup window.
It's working for me, but can this be made more general so someone else can use it?