• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Custom Fields and lang php files
PostPosted: Fri Dec 04, 2009 5:10 pm 
Offline
Forum Members
Forum Members

Joined: Sun Jul 19, 2009 9:52 pm
Posts: 36
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:
$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:
$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...)


Top
 Profile  
 
 Post subject: Re: Custom Fields and lang php files
PostPosted: Thu Dec 17, 2009 10:19 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Thu May 14, 2009 8:11 pm
Posts: 1269
Location: Lithuania
Quote:
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:
{tr_key key='price' lang=$lang}

instead of
Code:
{$mod->Lang('price')}

or just
Code:
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:
{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.

_________________
My best friends are: FAQ: How can I debug my code/site ?...showtemplate=false...module_customhow to create a patch, {process_pagedata}
And Yours ? :)


Last edited by Peciura on Mon Mar 15, 2010 11:58 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Arvixe - A CMSMS Partner