Member
Member
gromit   2011-02-12, 16:18
#1

Hi,
Firstly, thanks for Zenphoto - I love it

Secondly...
I love having the gallery on the front page. However, I'd like to be able to have a different collection of albums on the front page (index.php) than the main gallery.
My main reason is to have a few portfolio albums on the front page, with all other albums showing up in the main gallery page.
Is this possible in a neat way (e.g. showing a collection of sub albums) or will I need to copy the gallery.php code and hack it around for the index page?

I'm using zpgallerific if that helps!

Many thanks in advance!

Administrator
Administrator
acrylian   2011-02-12, 16:28
#2

Please read the theming and the object model tutorial.

Member
Member
gromit   2011-02-14, 22:50
#3

Thank you.
Dumb question time - can I set $_zp_current_album manually?
I'm trying to call printCustomAlbumThumbImage() but it obviously needs the current album setting, and I'm trying to do this manually.

Member
Member
sbillard   2011-02-15, 01:07
#4

Yes, of course. But don't do it in the "wrong" place--that is when it has been setup otherwise for some loop. You should check the function makeAlbumCurrent() as it is probably what you want. (Don't hold me to the spelling--I did not look it up.)

Member
Member
gromit   2011-02-19, 15:24
#5

That seems to be exactly what I want - thanks!

However, I can't get it to work, and I'm not sure why....
A quick demo:
If I used the code
'

'
Then it returns 'weddings' on the page

But if I set it manually:
'

'
It returns with:
'
Fatal error: Call to a member function getTitle() on a non-object in /home/photog/public_html/zp-core/template-functions.php on line 84
'

I'm not sure what I'm doing wrong - I've tried the album title as a bare string, with ' and with " and also the album ID from the database. All have the same results.

Help?!

Administrator
Administrator
acrylian   2011-02-19, 16:11
#6

Yes, you should probably read the documentation more carefully. makeAlbumCurrent() requires the album object. This needs to be created before using this. You NEVER use the title of anything for this but the name

Within the next_album loop the current album is setup anyway for each album listed. If you want to use the next_album loop within an album for its subalbums you have to setup its album object before the loop naturally.

Recommended read:
http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/

Member
Member
gromit   2011-02-20, 12:47
#7

D'oh! I was being rather silly and have been looking at the theme .php files only...

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.