Unhappily, PR #21695 was merged
Now, one has to click on search tools to define for which language site or admin to make the override.
It will always default to the alpha order of the language (and site) if not selected through searchTools when creating a new override.
We have to find a better solution imho.
I mean we may still use searchtools to filter (although we need a solution to display all overrides as the new field does not provide a possible empty Option), but we need a specific field separated from SearchTools to select to which language and client we want to create a new override for.
Instead of
and then click to get
We need at least something like
and possibly modify the override edit form to choose there the language/client.
This is not so easy to do.
To obtain the screenshot above, I moved the language_client
field out of the filter
fields as we do usually (plus added an option), and added a new layout where bar.php is customised.
so I did for filter_overrides.xml
<?xml version="1.0" encoding="utf-8"?>
<form>
<field
name="language_client"
type="languageclient"
filtermode="selector"
onchange="this.form.submit();"
>
<option value="">COM_LANGUAGES_OVERRIDE_SELECT_LANGUAGE</option>
</field>
<fields name="filter">
<field
name="search"
type="text"
label="JSEARCH_FILTER"
description="COM_LANGUAGES_SEARCH_IN_TITLE"
hint="JSEARCH_FILTER"
/>
</fields>
<fields name="list">
<field
name="limit"
type="limitbox"
label="JGLOBAL_LIMIT"
description="JGLOBAL_LIMIT"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
and for the specific bar.php layout
defined('JPATH_BASE') or die;
$data = $displayData;
if ($data['view'] instanceof LanguagesViewOverrides)
{
// We will get the language_client filter & remove it from the form filters
$langClient = $data['view']->filterForm->getField('language_client'); ?>
<div class="js-stools-field-filter js-stools-language_client">
<?php echo $langClient->input; ?>
</div>
<?php
}
// Display the main joomla layout
echo JLayoutHelper::render('joomla.searchtools.default.bar', $data, null, array('component' => 'none')); ?>
I also had to modify for the sake of the demo, i.e. to display the Select:
// Add the languages to the internal cache.
$this->cache = array_merge(parent::getOptions(), $languages);
in the new languageclient
new field type
It does not work, i.e. the select box sticks its value to the first language in alpha order and site client.
Labels |
Added:
?
|
Status | New | ⇒ | Discussion |
Category | ⇒ | com_languages |
Labels |
Added:
J3 Issue
|
Labels |
Added:
?
|
What have you done to get it to stick to something else than en-GB site ?
I could not do that here.
ah never tested that - it always returns to the first item :(
I am guessing it is because the values in the select are a combination of language and client eg value=en-gb1
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-09-10 01:00:20 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
OK I tried and hit the same problem. I can change it so that the select is displayed but I cant get that data into the edit form