Custom Fields and lang php files

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
cmaunoury
Forum Members
Forum Members
Posts: 36
Joined: Sun Jul 19, 2009 9:52 pm

Custom Fields and lang php files

Post by cmaunoury »

Hi everyone,

I am building a website using modules such as Company Directory or Products for other uses than their primary ones (i.e. using Products for a Project pages, etc.). To make it possible - and easier for my client, I have to tweak the way the module displays in the admin area, with the method described by Calguy here: http://calguy1000.com/Blogs/6/60.html.

So far, so good, it works great.
Thing is, I am using an extensive amount of custom fields in the Products and the Company Directory modules AND I have a multilanguage website built with MLE.

I have seen some other topics flirting with this subject but none really tackling it: is there a way to call the custom fields in the languages files? That would be so comfortable to work with the admin area and the templates. And I would not have to build one version of each template per language I am using, calling them through categories, which is a huge loss of time and sometimes of possibilities for the modules...

I have tried the basic:

Code: Select all

$lang['myfield'] = 'My Field';

to no avail...

I was wondering if maybe there was a similar way as the one used to call them in the templates, something like:

Code: Select all

$lang['customfieldsbyname.myfield '] = 'My Field';
but did not work either...

Any input, idea or theory on this matter?

Thanks a bunch!

Colin

Using: CMSMS 1.6.6 "Bonde" with Products 2.4.3, Company Directory 1.4.1 (but this is a subject that would apply to any module put in a module_custom directory...)
Peciura

Re: Custom Fields and lang php files

Post by Peciura »

And I would not have to build one version of each template per language
To build one template for all languages i am using "Translation Manager" module (this way i have reusable dictionary)

Code: Select all

{tr_key key='price' lang=$lang}
instead of

Code: Select all

{$mod->Lang('price')}
or just

Code: Select all

Price

Edit:
If you want to access translation from any module ('CGBlog' in this case) and use in any template write similar smarty structure

Code: Select all

{assign var='temp_translation' value=`$gCms->modules.CGBlog.object`}
{$temp_translation->Lang('firstpage')}
It is enough to assign module once and "$temp_translation" can be used as many times as you want to.
Last edited by Peciura on Mon Mar 15, 2010 11:58 am, edited 1 time in total.
Locked

Return to “[locked] CMSMS MLE fork”