Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Plugin - CustomFields
#51
Hey guys. Not sure where to post this, so i'll just go ahead and do that here to start with. This is a great plugin and adds nice functionality that is needed. Though i am no backend guy, only frontend really and would like to know if it would be able to work with the i18n plugin to separate the languages. since it seems to only display the default language. Does anybody have an idea? Help would be greatly appreciated, since on a multilanguage project based on gs. Thx
Reply
#52
linden Wrote:Hey guys. Not sure where to post this, so i'll just go ahead and do that here to start with. This is a great plugin and adds nice functionality that is needed. Though i am no backend guy, only frontend really and would like to know if it would be able to work with the i18n plugin to separate the languages. since it seems to only display the default language. Does anybody have an idea? Help would be greatly appreciated, since on a multilanguage project based on gs. Thx

There is currently no "nice" way to "add" a new language for the I18n plugin. You have to manually create a page and give it a slug name with "_" + language code, e.g. "index_de". After you save this page, the I18N view will display a second column with this language.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#53
Thanks for the answer. Though i have already created all the pages with neccesary langcode. like index and then index_en for example. So all pages are done and working smoothly. But if i use the "getCustomfield" code. It only displays the default language on the site. no matter what language i am currently on. i cant get the second language customfield to show, if you get what i mean?
Reply
#54
Would anyone have an idea at all? Any help appreciated.
Reply
#55
linden Wrote:Would anyone have an idea at all? Any help appreciated.

I don't use the CustomField plugin and do not understand your problem.
What do you want to achieve?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#56
Right, yeah i might be in the wrong thread, but i am using the i18n plugin to have 2 languages on a site, SE and EN. and when i switch between the languages when browsing the site using get_page_content(); and get_i18n_component those fields are showing the current language. But i also would need som customfields to add a couple of more for instance headlines to the page that i want on both languages. but by just using getCustomfield it wont use the current sessions language. I have SE as default, and if i switch to EN the SE customField is still showing. Smile God i feel that my explanations are so great. Hope it makes any sence.
Reply
#57
The newest version (0.9.5) of the I18N plugin (http://get-simple.info/extend/plugin/i18n/69/) supports custom fields: use get_custom_field($name) or return_custom_field($name) to display/get the value for the current language.

You might want to use the new I18N Custom Fields plugin (http://get-simple.info/extend/plugin/i18...ields/100/, based on n00dles101's CustomFields plugin) instead of the CustomFields plugin, as it offers more field types, a GUI to define the fields and is more efficient when used with the I18N plugin. See http://get-simple.info/forum/topic/1537/...-and-i18n/ for more information.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#58
mvlcek Wrote:The newest version (0.9.5) of the I18N plugin (http://get-simple.info/extend/plugin/i18n/69/) supports custom fields: use get_custom_field($name) or return_custom_field($name) to display/get the value for the current language.

You might want to use the new I18N Custom Fields plugin (http://get-simple.info/extend/plugin/i18...ields/100/, based on n00dles101's CustomFields plugin) instead of the CustomFields plugin, as it offers more field types, a GUI to define the fields and is more efficient when used with the I18N plugin. See http://get-simple.info/forum/topic/1537/...-and-i18n/ for more information.

This is great! i havent had time to try it fully, but i installed it and just by looking at it and that its managed in the admin area, and has a wysiwyg option makes this a great tool. Thanks for this! Smile This will truly make a big difference.
Reply
#59
linden Wrote:This is great! i havent had time to try it fully, but i installed it and just by looking at it and that its managed in the admin area, and has a wysiwyg option makes this a great tool. Thanks for this! Smile This will truly make a big difference.

I just uploaded a correction of both I18N and I18N Custom Fields, because in some circumstances (different order of loading the plugins) it would cause an error. Please download again.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#60
@mvlcek Great job... haven't had any time lately to update my plugin...
Miles better than anything I would have done....
My Github Repos: Github
Website: DigiMute
Reply
#61
n00dles101 Wrote:Say you wanted to have a different header image on each page. You would have something like this on your theme.

Code:
<div id="header">
<img src="yourimage.jpg" alt="" />
</div>

Install the customfields plugin and edit or create /pages/other/customfields.xml
and add the following.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<channel>
<item><desc>image</desc><label>Header Image</label><type>text</type></item>
</channel>

Each <item> must have 3 parts,
desc - id of the customfield
label - what to display on the page edit form
type - type of field, either text or dropdown.
if type is dropdown add <option></option> tags with whatever you want in the dropdown menu

Now when you edit your pages you should have a new field "Header Image"

Change your template file to use the following instead

Code:
<div id="header">
<img src="<?php getCustomField('image');" alt="" />
</div>

Simple example, check out http://cmstest.digimute.com
which uses 3 new fields to create the portfolio - subtitle, image and jobtype.

Hope it helps, let me know if you need more info.

Mike.

I would like to say thanks for making this plugin. It is exactly the thing I need for my problem plus I can use it for dynamicly change other pages without hassling to much with the code. But.....

How can one intergrate this in the Abacus theme ?

I have done the things in the quote. But I think things go bad when I put the div in the theme php.

Now all the pages go blank.

I know that Im a noob (dont tell anybody). I also know i am doing something wrong. I simply cant figure out what.

Please help ?
Reply
#62
Did it Smile

Changed the

<img src="<?php getCustomField('image');" alt="" />
to
<img src="<?php getCustomField('image'); ?>" />

and it works

Can I do somthing about an empty "Header Image" field which displays a red cross on the website ?
Reply
#63
Mandelain Wrote:Can I do somthing about an empty "Header Image" field which displays a red cross on the website ?
Give a linky to see what's the problem.
I guess path to the file isn't right.
Addons: blue business theme, Online Visitors, Notepad
Reply
#64
Would love to but the testsite is running internal so that would be a problem.

The broken link is there because it looks for an image which isnt there because I gave nothing up in the Header Image field. It would be easy to set an image in every page. But thats not very friendly for the cms user so If I give a background image up in the css than if there isnt an Image it would show the background.

Now it shows the background with a broken link.

Isnt there a script (div code) that surpases the image if there is none ?
Reply
#65
You can check, if the field is filled:

Code:
<?php if (returnCustomField("image")) { ?><img src="<?php getCustomField('image'); ?>" /><?php } ?>
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#66
Mlvcek: could you add a wysiwyg section, click on img button and confirm that img window lacks browse button ?

edit: btw, did you try to paste a code of a gallery created using simple image gallery plugin into a customfield ?
It isn't processed and just show a plain text. I didn't test it with other plugins but I think it would end similarly.
Addons: blue business theme, Online Visitors, Notepad
Reply
#67
yojoe Wrote:Mlvcek: could you add a wysiwyg section, click on img button and confirm that img window lacks browse button ?

The I18N Custom Fields plugin is not yet (fully) compatible with GetSimple 3.0b:
  • fields are not shown correctly in the edit page view
  • WYSIWYG text area has the behavior like the content field in 2.03, thus no browse button.

BTW: Let's move questions/discussions on the I18N Custom Fields plugin to the correct thread at http://get-simple.info/forum/topic/1537/...-and-i18n/.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#68
mvlcek Wrote:You can check, if the field is filled:

Code:
<?php if (returnCustomField("image")) { ?><img src="<?php getCustomField('image'); ?>" /><?php } ?>

Thanks
Reply




Users browsing this thread: 1 Guest(s)