Jump to content

(solved) LoginRegister: prevent inputfields to render in all the installed languages.


Sanyaissues
 Share

Recommended Posts

Update: The render behavior of the profile is correct. My mistake was to use TextLanguage in the fields  when i just need the user to see labels according of his language (that can be achieved with the text field type).

Hi,

I'm using LoginRegister to allow users to edit their users profiles in the front-end, and some of the user fields are type TextLanguage (to allow multiple languages).
The problem is that when I render the Profile Edit, the inputfields shows in all the installed languages. That doesn't happen when I render the login or register forms.

How can i prevent that the TextLanguage inputfields render in both languages?

My code

<?php
  $user->language = $languages->get("default");
  $input->get->profile = 1;
  $profileForm = $modules->get('LoginRegister')->set('renderStyles', false)->execute();
?>
and later...
<?= $profileForm ?>

The output for an multilanguage inputfield:

<div class="InputfieldContent ">
  <div class="LanguageSupport" id="langTab_Inputfield_profile_firstname" data-language="1029">
    <label for="Inputfield_profile_firstname" class="LanguageSupportLabel detail">English</label>
    <input id="Inputfield_profile_firstname" class="InputfieldMaxWidth" name="profile_firstname" type="text" maxlength="2048">
  </div>
  <div class="LanguageSupport" id="langTab_Inputfield_profile_firstname__1031" data-language="1031">
    <label for="Inputfield_profile_firstname__1031" class="LanguageSupportLabel detail">Spanish</label>
    <input id="Inputfield_profile_firstname__1031" class="InputfieldMaxWidth" name="profile_firstname__1031" type="text" maxlength="2048">
  </div>
</div>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...