Custom Fields (and I18N) - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13) +--- Thread: Custom Fields (and I18N) (/showthread.php?tid=1404) |
Custom Fields (and I18N) - mvlcek - 2011-03-14 As I have been notified that the custom fields of n00dles101's plugin are not correctly displayed when using the I18N plugin (i.e. the values of the default language are always shown), I have improved the I18N plugin to version 0.9.5 (http://get-simple.info/extend/plugin/i18n/69/). It will now also read all extra fields from the page (correct language version) and make them available via the functions get_custom_field($name) and return_custom_field($name). Although this works, this is not very nice from an architectural point of view, e.g. page files are read by the I18N as well as the CustomFields plugins, values are available using getCustomField (default language) and get_custom_field (I18N, correct language), etc. For these reasons I have improved the CustomFields plugin:
And - as it uses the same configuration file - it is compatible with the CustomFields plugin (although the CustomFields plugin won't display the new field types). The new I18N Custom Fields plugin is available at http://get-simple.info/extend/plugin/i18n-custom-fields/100/. If you use the I18N plugin (http://get-simple.info/extend/plugin/i18n/69/), make sure, it is at least version 0.9.5 (better: 1.1.2). Installation Unzip to the plugins directory, then define the custom fields in the administration GUI at Plugins/Configure Custom Fields. To use browsing with link and image fields, turn on site wide cookies in gsconfig.php: Code: define('GSCOOKIEISSITEWIDE', TRUE); Usage Use any of the following functions in your template:
Custom Fields (and I18N) - polyfragmented - 2011-03-16 mvlcek, thanks a lot for your i18n-optimised custom fields plugin. I noticed in Extend that it's officially been tested against 2.03, but have you got it working with 3.0b as well? I'm running a testsite with 3.0b and wanted to play around with a custom field to be put into the body class attribute for context-specific CSS styling. I (think) I followed your instructions successfully, yet nothing is output. I defined a new field with the name of "site-language" and put the following function call into the body tag, analoguous to the get_page_slug(); call. Code: <body id="<?php get_page_slug(); ?>" class="<?php get_custom_field(site-language); ?>"> Code: <body id="some-page" class=""> If you need more info I'll gladly try to provide it. Keep up the good work! Custom Fields (and I18N) - mvlcek - 2011-03-16 polyfragmented Wrote:I defined a new field with the name of "site-language" and put the following function call into the body tag, analoguous to the get_page_slug(); call. It should work with 3.0b, but you definitely need quotes around the name (not sure why you don't get an error): Code: <?php get_custom_field("site-language"); ?> Custom Fields (and I18N) - polyfragmented - 2011-03-16 I just tried it with quotes as well, same result. I'll enable debugging, maybe that gives us a hint. Edit: no error whatsoever :/ Plus, the textfield on the edit page is not pre-filled with the default I set in the plugin config. Edit2: Prefill with new pages works. Custom Fields (and I18N) - mvlcek - 2011-03-16 polyfragmented Wrote:I just tried it with quotes as well, same result. Do you use the I18N CustomFields plugin together with the I18N plugin or standalone? Do you see the entered value in the custom field, when you edit the page again? If not, is the value stored in the page xml file? If you are using the I18N plugin, are you displaying the correct language version of the page? Custom Fields (and I18N) - polyfragmented - 2011-03-16 mvlcek Wrote:Do you use the I18N CustomFields plugin together with the I18N plugin or standalone?I use your custom fields plugin standalone. mvlcek Wrote:Do you see the entered value in the custom field, when you edit the page again?Yes, the value is persistent after I enter it in the page options. It is stored in the page XML file: Code: <site-language><![CDATA[de]]></site-language> Calling it a day for today, will check back here tomorrow again. Thanks for investigating! Custom Fields (and I18N) - linden - 2011-03-16 Hey mvlcek. I have been trying to get the i18n plugin and the i18customfields plugin to work for a while now. But i am still having problems. Really a noob here on the php end, so hard to debug not knowing what to look for. Anyway I am basing my testsite on GS 2.03.1, and using the latest i18n plugins. and i can create the customfields with no problem and also see that it is being save on the page. but nothing comes out on the site. i just empty. Using for example this line in my templates <?php get_custom_field($mainHeadline); ?> . Any idea what i could be doing wrong or what i could check somehow? Custom Fields (and I18N) - mvlcek - 2011-03-16 linden Wrote:Hey mvlcek. If the name of the custom field is "mainHeadline" (without the quotes), you should use Code: <?php get_custom_field("mainHeadline"); ?> Custom Fields (and I18N) - linden - 2011-03-16 mvlcek Wrote:linden Wrote:Hey mvlcek. Of course. Thx works fine now. Custom Fields (and I18N) - polyfragmented - 2011-03-16 Just tried renaming the custom field name to something without a dash, still the same result. :/ I'm stumped. Custom Fields (and I18N) - polyfragmented - 2011-03-17 I edited a post further up: Prefill with new pages works.. --- Would it be possible to generate a custom field which is shown n times? I'm thinking of links added to a page via text fields or lists. Maybe something similar to how you manage the dropdown field, but with (un)ordered lists? Custom Fields (and I18N) - mvlcek - 2011-03-17 polyfragmented Wrote:Would it be possible to generate a custom field which is shown n times? I'm thinking of links added to a page via text fields or lists. Maybe something similar to how you manage the dropdown field, but with (un)ordered lists? Do you mean a list like a dropdown, but multiple entries are selectable? Custom Fields (and I18N) - polyfragmented - 2011-03-17 mvlcek Wrote:Do you mean a list like a dropdown, but multiple entries are selectable?Let my clarify, I am looking for a way to input, say, multiple links in a page's options which are then output on-page. In whatever form - (un)ordered lists, definition lists, whatever tickles the fancy. After re-writing what I'd like to happen, I notice that my mentioning of dropdown fields is probably nonsensical. I can imagine the custom field being put in the page options n times if text fields are used so I can input a handful of links. Not looking for selecting from a pre-defined list by way of a dropdown. Custom Fields (and I18N) - yojoe - 2011-03-23 mvlcek Wrote:The I18N Custom Fields plugin is not yet (fully) compatible with GetSimple 3.0b: I've noticed that there's a similar problem I had. You're not escaping commas when saving the file nor loading its content, thus every link pasted in text input won't be displayed, and will break the window after reloading page in edit mode. Gotta look at mine own changes in Noodle's basic version, as I'd like to use your customfields remake, but it needs fixes. edit: k, stripslashes($value) and turning off magic quotes did the thing Custom Fields (and I18N) - mvlcek - 2011-03-26 yojoe Wrote:I've noticed that there's a similar problem I had. You're not escaping commas when saving the file nor loading its content, thus every link pasted in text input won't be displayed, and will break the window after reloading page in edit mode. This should be fixed with version 1.3. And the texts have been moved to language files - using my Translate plugin has sped this up for sure ;-) Custom Fields (and I18N) - mvlcek - 2011-04-01 Version 1.4:
Custom Fields (and I18N) - polyfragmented - 2011-04-01 Just installed 1.4 into GS 3.0 and, after filling in a new custom field config and hitting save, got the following: Code: Warning: copy(/www/htdocs/foo/testlab/data/other/customfields.xml) [function.copy]: failed to open stream: No such file or directory in /www/htdocs/foo/testlab/plugins/i18n_customfields/configure.php on line 14 The custom field does not get saved. What gives? Custom Fields (and I18N) - mvlcek - 2011-04-02 polyfragmented Wrote:The custom field does not get saved. Undo preparation was preventing save, if there was no old customfields.xml. Fixed in version 1.4.1. Custom Fields (and I18N) - linden - 2011-04-04 Loving this plugin. And wondering if there would be a way to "link" certain custom fields to a specific template. like for instance if i have 2 pages with different templates. and i would have different informations on them. I would like to have a certain set of custom fields on startpage for example with banner areas or different columns with information. and the standard page would just have content and maybe a sidebar. So different customfields depending on what template i am using. That would make me a really happy man Might want to add that i would want the certain customfields showing on only that perticular page that i would specify. Otherwise i know i could t it as it is already. But i dont want all customfields showing on all pages. Hope you understand what i mean. Custom Fields (and I18N) - ragou - 2011-04-07 Hi, I'm sorry for my English The plugin works fine, but there is a slight problem. When I try to insert an image in the main content editor a button "Browse server" apears in the image properties window, but it doesn't in the custom field editor Is there any chance to fix this? Custom Fields (and I18N) - mvlcek - 2011-04-07 ragou Wrote:When I try to insert an image in the main content editor a button "Browse server" apears in the image properties window, but it doesn't in the custom field editor It's on my to do list. Custom Fields (and I18N) - polyfragmented - 2011-04-09 In the page options right above the "Custom Fields" headline Quote:Notice: Trying to get property of non-object in /www/htdocs/foo/testlab/plugins/i18n_customfields/edit.php on line 11 Does not seem to affect page saving at all. Custom Fields (and I18N) - mvlcek - 2011-04-09 Version 1.5 is available:
@linden: showing fields depending on a template is much too complex to implement (showing/hiding fields, when template is changed, templates are dependent on current theme, ...) Custom Fields (and I18N) - linden - 2011-04-09 mvlcek Wrote:Version 1.5 is available: Ok, yeah i just work at front-end so i dont know what is possible. just a thought. Thx for a super plugin anyway. And just got better with link and image support. Custom Fields (and I18N) - Angryboy - 2011-04-10 Thanks again for updating this plugin When I click on the 'Browse' button given by the functionality of the two new fields, a page does pop up, but it remains blank. Am I doing something wrong? |