Jump to content

Language (Tab) Order


Noel Boss
 Share

Recommended Posts

Hi everyone 🙌

Is there a way to order the language tabs in the backend? Currently, they seem to be ordered based on the created date (or id?) …

( time passes … 🚶‍♂️)

Just answered my own question. One can reorder the languages in the page tree under admin » languages or directly in the DB » pages » template_id=54 » sord field.

Anyone knows if there are side effects when moving the default language from sort 0 to somewhere higher?

Link to comment
Share on other sites

On 10/29/2019 at 11:06 PM, d'Hinnisdaël said:

Is the default language tab still initially active after you increase its sort value? Or does PW always focus/activate the first visible tab?

Which tab is initially activated depends on the chosen user language. 

See \wire\modules\LanguageSupport\LanguageTabs.module line 69:

// determine the index of the tab for the user's language	
  $activeTab = 0;
  foreach($this->languages as $index => $lang) {
  if($lang->id == $language->id) $activeTab = $index;
}

 

  • Like 1
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By daniel_puehringer
      Hey community,
      first of all: I love this CMS! But unfortunately my Code Internationalization (i18n) doesn´t work within included php files:
      I´m using the module Pro Fields Page Table, the regular Languages Support Module and no template caching. The website has 2 Languages (DE as default, EN as second language)
      Problem:
      Using
      <?php echo(__('Test')); ?> within /site/templates/home.php works without any problems and gets translated correctly
      However using
      <?php echo($this->_('Headline'));?> within /site/templates/components/component.php does not work.
      Note: using
      <?php echo(__('Headline'));?> in .../component.php throws an error and therefore cannot be used.
       
      Example:
      /site/templates/ce-includer.php (Template with the dynamic text-field 'filepath'):
      include('components/'.$page->filepath); this correclty includes the file "/site/templates/components/home-content.php"
      Code in home-content.php:
      <h1><?php echo($this->_('Headline'));?></h1>
      Output for both pages (DE and EN version - the string was translated to "Headline DE" in german and "Headline EN" in english):
      <h1>Headline</h1> Does anyone know how to use Code Internationalization in such a szenario?

      All the best and keep up the great work!
      Daniel
    • By donatas
      Hello,
      how would I do a multi-language website search with just a selector?
      I have many multi-lang fields and I want to do a search through all of them at once and through all of their language values.
      Is there a "selector way" of doing this? Maybe something like `title|title:de|title:it`? It seems I have seen this somewhere a long time ago but can't find in any documentation or forum search...
      Or the only way of doing it is by running separate searches for each language with output formatting off and then consolidating it all in one single results array?
      Because I still want to give users a result, even if it is in another language than current $user. Visitors mostly will be searching for specific terms that are very similar in all languages, but might be not used in one language version of a single page, for example. Or the user might not have switched language tohis prefered and did the search first, etc.. (many use cases in my situation)
      Example:
      $pages->find('title~='.$q) - maybe different operator is needed? /en/search/?q=visit = 1 results /it/search/?q=visit = 0 results Thanks for any advice!
    • By sebr
      Hello
      One of my customers needs to have his site translated by a publisher. He asks me if it is possible to create a role that could only edit the German version of the pages, without permission on the English version.
      I haven't found any permission related to this need, but maybe it's possible from a hook?
      Thank you for your help
       
    • By opalepatrick
      Hi, trying to order pages by modified date, date. I can do 'sort=-date_modified, sort=-date' but that will always put the modified date first regardless of actual date order. I just want to coalesce the two fields and sort. Any ideas would be appreciated.
    • By gerritvanaaken
      Wouldn’t it be cool to have whole repeater items (or even repeater matrix items) language-specific. Some of my clients do have pages that are 90% identical in German and English, but there are some sections that should not appear in one or another language. I attached a concept screenshot.
      Would something like this be possible with some simple backend hooks and "hidden checkbox fields"? Or is it way more complicated?
       

×
×
  • Create New...