Jaanus
Super Moderator
Hi,
I'm trying to create something new again this time for list view in element level. And I need help to understand something.
In list view, parseMessageForRowHolder() replaces {tablename___elementname} with data, isn't it?
OK, when I use such placeholder in element's custom link param then it's parsed. In models/element.php parseMessageForRowHolder() seems to do this work.
But now I'm trying to make element to show under its original data also some data from other element(s) without any need to create a new calc element (and new database field) for this.
I created 2 new params 'other_data' and 'other_always' (means that it shows other data even when there are no original data displayed).
And in element.php I added some lines (since about 4380) into function renderListData:
Unfortunately, no parsing happens. When I write in 'other_data' param such string as e.g 'Other {tablename___elementname}' then this code "works" only for the word "Other" that is shown where needed - without any data that should replace {tablename___elementname}.
What is wrong? Do I need some second argument? e.g $listModel->parseMessageForRowHolder($params->get('other_data'), $some_second_argument)?
Many thanks in advance
I'm trying to create something new again this time for list view in element level. And I need help to understand something.
In list view, parseMessageForRowHolder() replaces {tablename___elementname} with data, isn't it?
OK, when I use such placeholder in element's custom link param then it's parsed. In models/element.php parseMessageForRowHolder() seems to do this work.
But now I'm trying to make element to show under its original data also some data from other element(s) without any need to create a new calc element (and new database field) for this.
I created 2 new params 'other_data' and 'other_always' (means that it shows other data even when there are no original data displayed).
And in element.php I added some lines (since about 4380) into function renderListData:
PHP:
$other = $listModel->parseMessageForRowHolder($params->get('other_data'));
$always = $params->get('other_always');
$final = $this->renderListDataFinal($data);
if ($other != '' && $this->renderListDataFinal($data) != '')
{
$final .= '<br />';
}
if (($this->renderListDataFinal($data) == '' && $always == '1') || $this->renderListDataFinal($data) != '')
{
$final .= $other;
}
return $final; //originally: return $this->renderListDataFinal($data);
Unfortunately, no parsing happens. When I write in 'other_data' param such string as e.g 'Other {tablename___elementname}' then this code "works" only for the word "Other" that is shown where needed - without any data that should replace {tablename___elementname}.
What is wrong? Do I need some second argument? e.g $listModel->parseMessageForRowHolder($params->get('other_data'), $some_second_argument)?
Many thanks in advance