![]() |
|
How to use customized data - 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: How to use customized data (/thread-11289.html) Pages:
1
2
|
How to use customized data - tosca - 22-08-2013 I'm not sure how they are called in the english version; in french, I see them as 'Données personnalisées' in both the album and image page of the admin interface. What can we put there, and how to format it? Unless I missed something, I didn't find any method to get the information that has been put in this field. Thanks for your answer. How to use customized data - tosca - 22-08-2013 Oops! Sorry, I just found the related functions in How to use customized data - acrylian - 22-08-2013 Please just switch the admin to the English language if you are asking something like that. We really don't understand French. Otherwise we really cannot help. Since this means apparently "custom data". That is an all purpose text field and it is up to you what you do with it exactly. You can attach The editor TinyMCE to it and use it like any other content field. You can add and output html or js code but not PHP code. For the latter the codeblocks are meant. How to use customized data - tosca - 22-08-2013 Where/how can I switch language in the admin? As for the custom data, I tried How to use customized data - acrylian - 22-08-2013
How to use customized data - tosca - 23-08-2013 I might be less-advanced level that you think. :-) The line before What could be the difference between those two? How to use customized data - acrylian - 23-08-2013 Ok, I didn't look direclty but your mistake is that
How to use customized data - tosca - 23-08-2013 Thanks for the explanation. I've now managed to make work the function without an error. But I've not still found the best way to manage more than one information for some several albums:
Any suggestion to do this, in a manner that could be simply managed with different values for several albums? How to use customized data - acrylian - 23-08-2013 Codeblocks are meant to execute code on the theme dependent on an item. If you need to store values you want to use on the theme page itself you maybe should modify the theme. Codeblocks are executed within a function os it is captured within. You could try to use global variable but then you need to modify the theme to use it anyway. You can create arrays out of like "158,108" or "158/108) using the php standard function explode. How to use customized data - Papyrus - 23-08-2013 Normally, if I were to create custom sizes I would modify as needed on the index, album, favorites, and image page to suit my taste. Reading your comment it seems you want different image sizes depending on which album is called up. Having seen how to do this in the past, if you do not need a ton of different sizes, the best way to do so is to create variant themes and use the plugin that allows a different theme assignment per album then call the modified page. Can't remember the plugin name right off, sure someone else can contribute it if yoy can't find it. How to use customized data - sbillard - 23-08-2013 The custom data field may be used to store array information since it stores arbitrary content. A little PHP knowledge is required here, though. You will need to serialize the array before storing it in the custom data field and unserialize it when retrieving it. How to use customized data - sbillard - 23-08-2013 The plugin @papyrus refers to is the How to use customized data - fretzl - 23-08-2013 @Papyrus: You mean the How to use customized data - acrylian - 23-08-2013 Answer shoot out today How to use customized data - tosca - 23-08-2013 May be some explanations are in order:
@acrylian: I tried to use global variables, but it didn't work. I probably dit it wrong... can I find somewhere an example of codeblock in that manner? How to use customized data - acrylian - 23-08-2013
Globals and codeblock: We don't have any example I fear. I haven't tried this, it was just a quick idea. Language: That would mean you don't have an English/US locale on your server. The languages are tied to those available. My live server for example has only English and German, so French would not work (my local MAMP server has them all though). Maybe contact your host if they can set it up. It would just help us if we use the same terms when supporting. How to use customized data - tosca - 23-08-2013
I'll go on trying some things tomorrow, and will revert to a hard-coded solution if I don't find quickly something more sustainable. Language: I have no idea what the limits of my hosting service are. And I've recently reinstalled locally a new Linux/Fedora version and didn't take time to set up a new local server; guess I'll do it when my Zenphoto gallery will be public so I have no other option if I want to prepare other modifications! How to use customized data - acrylian - 23-08-2013
Re: language: We have a script to display available locales: https://github.com/zenphoto/Unsupported/tree/master/misc/list_locales How to use customized data - tosca - 23-08-2013
I found out the answer for the language: I needed to deactivate the French otherwise it remains the default. Deactivation of the HTTP_AcceptLanguage was not enough apparently. How to use customized data - Papyrus - 23-08-2013 Ha, thanks everyone for filling in the plugin name. I'd have to say custom codeblocks or functions aren't any simpler than just having one modified line per page that needs modification as you'd run into with the multiple layouts method if you wanted to go that way. That being said, here is another method that would require a touch more work but could accomplish the goal with one function. What you could do is grab the URI and match against a list of album names (likely at the top level, where you split into postcards, photo books, etc.. so it'd automatically apply to sub-albums) grab that album name, set it as a variable, then run a loop that checks the variable and (if x album, then y dimensions) prints that on the page. A bit more work but only one function to maintain. |