Meddysong Posted May 29, 2018 Share Posted May 29, 2018 My site is bilingual and filtering necessarily produces the "filtered by:" message with the field values in only one language because it looks up $data['value'], which is not a translatable field. I'm trying to come up with a work-around and I think I've got something. I think I could store some language strings as a prefix plus the key name for the field. (meddysong_1, meddysong_2 and so on.) Then in the template, I could use {lang="meddysong_"} with the key name appended. The problem is, I don't know how to get the key name. I've tried $data['key'], $data['name'], $data['formValue'] and am getting nothing back. Only $data['value'] produces anything. What would be the equivalent for the key? And, more generally, how would I go about seeing what properties something has so that I don't have to ask next time I have a question like this? Edit: For clarity's sake, I should make it clear that I'm editing the filterMessage template from the Listing template set: <div class='ipsMessage ipsMessage_general'> <a href='{$category->url()->csrf()->setQueryString( array( "do" => "clearFilters", 'd' => \IPS\cms\Databases\Dispatcher::i()->databaseId ) )}' class='ipsPos_right ipsButton ipsButton_veryLight ipsButton_verySmall'>{lang="cms_database_filtered_clear"}</a> {lang="cms_database_filtered_by"} {{foreach $activeFilters as $id => $data}} {$data['field']->_title} ({$data['value']}) {{endforeach}} </div> Link to comment Share on other sites More sharing options...
newbie LAC Posted May 31, 2018 Share Posted May 31, 2018 On 5/29/2018 at 11:17 PM, Meddysong said: I think I could store some language strings as a prefix plus the key name for the field. Do you mean template key? If so use $data['field']->key Link to comment Share on other sites More sharing options...
Meddysong Posted May 31, 2018 Author Share Posted May 31, 2018 6 minutes ago, newbie LAC said: Do you mean template key? Sadly not. It's a select box: What I'd like is the keys here. Then I can create some language strings (meddysong_translation, meddysong_proofreading) and hopefully display the translations rather than be forced to use the values that are only in English. Link to comment Share on other sites More sharing options...
newbie LAC Posted May 31, 2018 Share Posted May 31, 2018 8 minutes ago, Meddysong said: What I'd like is the keys here. $data['field']->extra return an array like Array ( [translation] => Translation [proofreading] => Proofreading [chatting on skype] => Chatting on skype [graphics] => Graphics ) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.