ZenphotoCMS Forum
css class on body depenging on album - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: css class on body depenging on album (/thread-4132.html)



css class on body depenging on album - sambody - 2008-11-26

Hi. I'd like to find a way to add a css class (or id) to the body element, depending on the main parent album that I'm in. So that I can create special styles only for certain albums. For example: . Does anyone know how to do this ?




css class on body depenging on album - acrylian - 2008-11-26

This function gets the top level parent of an album:
http://www.zenphoto.org/documentation/functions/_functions.php.html#functiongetUrAlbum




css class on body depenging on album - sambody - 2009-01-08

So how exactly should I use it ? I have tried these:




css class on body depenging on album - acrylian - 2009-01-08

If you want it to be printed you need use ``.




css class on body depenging on album - sambody - 2009-01-08

I've tried ``, but I still get no result - it's just empty. You can see a gallery page here.

The image is the album "mariages", which is in the album "laeticia". I need to get that top album printed. Any ideas ?




css class on body depenging on album - acrylian - 2009-01-08

You need to pass the album object of the current album to that function (sorry forgot to say but it's actually documentated):
getUrAlbum($_zp_current_album);




css class on body depenging on album - sambody - 2009-01-08

still no success - worse, it actually makes everthing coming after `




css class on body depenging on album - sambody - 2009-01-08

the zenphoto files (index.php, zp-core folder etc) are in the root folder - could this be the problem ? (or the fact that php safe mode is still on ?)




css class on body depenging on album - sbillard - 2009-01-09

You should review the function definition/documentation for that function. It returns an album object, not a string. Try $album = getUrAlbum($_zp_current_album); echo $album->name;

Generally, it is a good idea to read the documentation on functions you intend to use. Don't expect the developers to remember details while reading posts.




css class on body depenging on album - sambody - 2009-01-09

Thank you sbillard and acrylian. My body element now looks like this: `