In one implementation of zenphoto, using zenpage, I would like to go from the subapbums staright to the first image in the album with the jcarousel slide strip on top.
The image pages show the jcarousel nav properly but I can't see any way to go from the subablum listing straight to that without the intervening page of album thmbnails 9obviously they are unnedded and redundant with the jcarousel.
Put another way, I go to the albums page, pick one, get the listing of subalbums, click one, see a page full of thumbs I DON'T want to see, click one and get the image page with the jcarousel nav. OHow do I skip the page full of thumbs.
See here if this doesn't seem clear:
http://www.adrianrtio.com/portfolio
Comments
Recommending readings first the theming tutorial and then the object model tutorial.
I will check into the docs you suggest.
Thx
<?php echo html_encode(getAlbumLinkURL());?> and since in the wile loop for images lists this gets the link to the image
<?php echo html_encode(getImageLinkURL());?>
I would expect either a combination of <?php echo html_encode(getAlbumLinkURL());?><?php echo html_encode(getImageLinkURL());?>
or just the second part to ge me what I need as a url.
But in the album while loop the getimagelinkurl returns nothing. I can't find any syntax references and it seems there are no code examples and the site is not searchable by functions names like getimagelinkurl so any help on the syntax to get the url to the first image in the album during the album while loop would be greatly appreciated.
It seems that is all i would need since if I hard code the image name onto the <?php echo html_encode(getAlbumLinkURL());?> I get exactly the results I want.
Please read the object model tutorial and read about the global object variables.
I would assume that the image calls would either take the current album as a starting point or you would be able to pass it an album as a parameter. But I see no syntax for that and, again, no examples other than combing through them code and trying to extrapolate. Since ANY image url in the gallery would work it only needs to return ANY image url so first, whatever one it found on access or last would work equally well.
Generally you have an object of an item like an album and can call its methods. Those methodes are documented for each class on the functions documentation.
I am sorry, the object model or more specific object orientation is nothing really Zenphoto specific. This is of course more advanced coding so you might need to learn a bit.
`
<?php $link_we_need = ""; ?>
<?php while (next_album()): ?>
<?php echo $link_we_need; ?>
<?php while (next_image()): ?> <?php if ($link_we_need == "") {$link_we_need = html_encode(getImageLinkURL());}?><?php endwhile; ?>
" title="<?php echo gettext('View album:'); ?> <?php getBareAlbumTitle();?>"><?php printCustomAlbumThumbImage(getBareAlbumTitle(), NULL, 95, 95, 95, 95); ?>
" title="<?php echo gettext('View album:'); ?> <?php printBareAlbumTitle();?>"><?php printAlbumTitle(); ?>
<?php printAlbumDate(""); ?><?php
if (function_exists('printAddToFavorites')) {
echo "<br />";
printAddToFavorites($_zp_current_album);
}
?>
<?php $link_we_need = ""; ?>
<?php endwhile; ?>
`
Hopefully this will help someone some time. Note the conditional stuff on the $link_we_need var is so we link to the jcarousel nave and image on the first, not the last, image of the album as going to the end is a little disconcerting.
Probably not the best way but I cant even find the next_image() function in the documentation and so don't know if there is a first_image function.
I hate to be critical of such a good project but the documentation and its search functions are woefully inadequate and an example, is like what I posted above, not something obvious but not very useful like the one you refer to in the tutorial which is simply:
For example to get the title of the current album selected you can use $_zp_current_album->getTitle(). This is actually the same as the template function getAlbumTitle().
Thanks for the project anyway.
(oh, and btw, I have been doing oop since the early 90's.)
next_image is a standard template function and found here:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html
You can easily find all functions using the browser page search here:
http://www.zenphoto.org/documentation/elementindex.html
All class methods are documentated and use normal oo.
There is no first image function but this album class method:
`$firstimage = $_zp_current_album->getImage(0)`
Documented here: http://www.zenphoto.org/documentation/classes/AlbumBase.html#methodgetImage
It is the album base class as we make use of the inheritance of classes. Those are listed on the tutorial and the functions documentation.
That returns an image object so from there on you can use the object methods to get all else, title,links whatever. Direct links to class documentation are here:
http://www.zenphoto.org/news/functions-documentation
PS: I see the object model tutorial does require an update for the current class nesting.
<?php echo $link_we_need; ?>
Obviously removable from the functioning code.
You often have to answer the same questions, and it is certainly very painful and frustrating. but the standard answer is often "RTFM" (documentation and tutorials of zenphoto).
Be sure this is probably not the best way to develop community zenphoto ...
However, sometimes there are real questions about good things zenphoto does not or does not do very well.
This is the case of this post on jcarousel_thumb_nav plugin.
The real value of this plugin is to avoid display of the image's thumbnails on the page of albums, but nothing explains how to do that.
Questions I ask myself on the code above:
- this code is for the gallery page (in case there are only albums and no sub-albums)?
- what will happen if all images in the album are not published?
- the limit of the solution is an album should not mix sub-albums and images?
Please, have some kindness on relevant posts that can advance zenphoto...
Our object model is fairly standard practice. If you know how to get the title of an object you know to get all else. All methods of the class objects are documented and sometimes you have to try a bit to find out what you need. DOn't think for example think I know all stuff offhand. I fairly often have to look at the doc myself. It really exceeds our resources to provide examples to everything.
Regarding the jCarousel and skipping the thumbnail view:
There are several ways to do that. In any case you have to modify the theme next_album loops to jump to the image as this is simply not the standard way.
Denn has shown one way using a nested next_image loop. I showed the rather proper way for the first image above as well (it is what we use on our site on the themes section). If you use that you get an image object and can do everything you can do with an image object. It's all the same scheme. What is available is documented.
If you jump to unpublished images directly you will just see them. On ZP you always can link to anything that is unpublished directly unless it is protected additionally.
Additionally the print_album_menu plugin has an option to use the first image insead the album thumbnail view if available. If the album you wish to link to has no direct images but only subalbums it will normally to the album to show those subalbums. So for usability reasons I would recommend to use that with jCarousel.
Using the menu manager and custom menus you can of course define it yourself.
As a theme author you know that modifying or writing a theme is a bit of work. I am sorry that there is sometimes no easy and direct answer. And we don't always know the background of people. If someone does not know PHP at least for the basics it is really work to explain things. The real flexibility of Zenphoto is - as with a lot CMS - the theming itself.
I agree that the forum search is quite bad, you get much better results if you use Google directly. There is sadly no way around as we currently lack the time to do a forum switch.
Please let me repeat that we welcome any help on the user guide which of course should have all necessary info (the functions documentation is automatically generated from the source so there is not much to do - no one really wants to do that manually!).
I hope this explains it a bit.