Thanks everybody for helping.
I've succeeded in what I wanted to do: in the custom data field, I can enter as many name=value separated by a comma, and get them as an array in the program.
The only thing that remains to make it 'perfect' is transforming it into a function so I can use it in any other php page.
@Papyrus: the purpose of using custom data or code block is precisely to avoid hard-coding. I didn't want either to make references to the album names or their parent.
With my solution, I have nothing to add/modify when I add a new album, or modify one that already exists. I can even add as many new variables as I want too, they will be automatically available in the program.
Well I'm very happy you worked it out. Always nice to see the different ways people tackle issues!
If it does help anyone in the future though, I whipped up my variant of the idea as a foundation. I'm sure many future visitors would appreciate any alternate methods you might be employing spelled out for them if you feel like it, tosca.
http://animepapers.org/software/zenphoto/code-snippets/multiple-layouts-dynamic-modification.html
Probably far from perfect, but if anybody needs a reference it's there with a tiny bit of documentation.
I'll also post here...and see how it comes out:
`
echo '"'.getImageTitle().'"';
`
@Papyrus: Some quick comments:
$masal = $_zp_current_album->getParent();
getParent() returns an album object if there is a parent or NULL, so it is quite different to $theDecider;
$theDecider = $_zp_current_album->getTitle();
You should use the album name here. The title is never unique identifier especially since it changes on multilingual sites per language naturally.
if ($theDecider = 'album-name-1')
You mean of course == ;-)
Here is the function I've written, but it is for retrieving custom data, whatever they are; in addition to custom thumbnails dimension, I've already used it to assign specific classes, and it could be used for anything else.
/* ** Récupération du contenu de "Données personnalisées" */ function mnaCustomData($page) { switch ($page) { case('album') : global $_zp_current_album; $custom_data = getAlbumCustomData(); break; case('image') : global $_zp_current_image; $custom_data = getImageCustomData(); break; case('page') : global $_zp_current_zenpage_page; $custom_data = getPageCustomData(); break; case('category') : global $_zp_current_category; $custom_data = getNewsCategoryCustomData(); break; case('news') : global $_zp_current_zenpage_news; $custom_data = getNewsCustomData(); break; } $data_array = explode(",",$custom_data); foreach ($data_array as $one_data) { $label_value = explode("=",$one_data); $custom_data_array[trim($label_value[0])] = trim($label_value[1]); } return $custom_data_array; }
@acrylian Ah! Thanks for the tips, will help me going forward. I knew that title was a bad thing to call but just couldn't remember off the top of my head what else to use...and it worked so I shrugged it off. Corrections are always appreciated.
@tosca I see, a little different from what I pictured but useful for more than just many levels of image sizing. Looks nice. Thanks for contributing your code snippet too!