Sign in to follow this  
Sanyaissues

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

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>

 

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By swampmusic
      Trying to figure out work flow for translators on a new website and have hit a brick wall.
      Site was launched in Spanish, now the translators want to add in other languages.
      I presumed that when you tick the "active" language checkbox on settings for the home page, then the new language would not appear on the public facing website, but translators would be able to work with the pages in the admin and view their work.
      Finally, once all translation had been completed, we could activate the language from the home page.
      I have searched thru the forums and found older articles from 2015 here.
      https://processwire.com/talk/topic/11100-disable-a-language-on-a-multilanguage-site/ https://processwire.com/talk/topic/10467-allow-translators-to-work-on-hidden-language/ This seems a really messy hack, or did i miss something ?
      Does anyone know if there has been an update within Processwire since 2015  to make this better/easier, or other articles explaining how to achieve it ?
      We were looking for a solution that the client can use from within Admin. Not via .htaccess or similar that would require tech skills.
      Many thanks for reading 🙂
       
    • By yinken
      Hi everyone,
      I am using ProcessWire to run a multi-site environment using the Multisite module by Soma.
      It's working great with one small caveat. It always defaults to the English version of the site. So when you access the base url (somedomain.com) it always redirects to somedomain.com/en/. In my particular case I need it to go to the Germany version somedomain.com/de/.
      Some things I've tried:
      I've tried fiddling around with the AutoDetectLanguage module to have a user redirected based on the detected browser language - didn't work. I've also tried messing with a module that changes what the default homepage is (smth like DefaultHomepage I believe), but that also had no affect. I used the Redirect module to have the root ('/') redirected to specific language URL ('/de/) - also didn't work My guess is that it has something to do with the default language in the setup which is set to english, but I am not sure.
      Has anyone else come accross this issue?
      Thanks in advance.
    • By Gideon So
      Hi,
      I have a website with multi-languages support and a frontend form for course registration. If a user choose English which is not the default language, the page title only save to the English tab of the page title.
      How can I save the page title to the default language through API??
      Gideon
    • By Mirza
      Hi All,
      Arabic content changes not available in page getChanges method
      While editing the page from admin panel in the multi-language field, added a hook to save the changes made to the page.
       
      $this->pages->addHookAfter('saveReady', $this, 'hookUpdateLog');  
      public function hookUpdateLog(HookEvent $event) { $page = $event->arguments[0]; if(in_array($page->template->name, $this->templateList)) { $this->logFieldChanges($page); } } public function logFieldChanges($page) { $changes = $page->getChanges(); //This changes does not contain the field of arabic changes. }
      Please let me know, If I am approaching in a right way.

    • By Mirza
      Support for Multi-Language field in Module: Import Pages from CSV file 
      Is there a support for multi language field import option from csv?
      If yes, what will be the structure for csv file data.
       
      Case scenario:
      I have title field which is multi-language field(English & Arabic).
      business|بزنيس
      club|كلوب
      deluxe|ديلوكس
      duplex|دوبلكس