Feature request
It is good to have at least the first few dozen characters of the tag descriptions shown in the admin tags list so you can see which tags are missing one or might need updating.
You can't quite achieve this with a template override of /administrator/components/com_tags/views/tags/tmpl/default.php because the description is not included in the model.
Thus a simple addition is needed to /administrator/components/com_tags/models/tags.php
in protected function getListQuery()
somewhere around line 140 amend
$this->getState(
'list.select',
'a.id, a.title, a.alias, a.note, a.published, a.access' .
', a.checked_out, a.checked_out_time, a.created_user_id' .
', a.path, a.parent_id, a.level, a.lft, a.rgt' .
', a.language, a.description'
)
adding , a.description
to the select
A template override can add a column for description using $item->description;
and implement any length limitation and display stuff required.
It throws errors (quite correctly) if you try to access $item->description;
j 3.9
macosx10.13.6 serving through MAMP
chrome browser
Actually if doing this you might as well implement the column in the view default.php
Personally I either restrict the length displayed to 100 chars and strip tags, or if I have a very long description I will break it into two parts with an <hr>
(would be better as a [readmore] but by default the readmore button is only available in article editing) and only display the text up to the <hr>
in list views (front and back ends) and use the full description when displaying the tag on its own.
Thus in /administrator/components/com_tags/views/tags/tmpl/default.php I have inserted a <th>...</th>
in the relevant place and use
<td class="hidden-phone"><span class="small">
<?php $text = $item->description;
$brkpos = strpos($text,'<hr />');
if ($brkpos) {
$text = substr($text,0, $brkpos);
echo strip_tags($text).' [more]';
} else {
echo JHtml::_('string.truncate', strip_tags($text), 100); //100 is my choice - could be a param
}
?>
</span></td>
to display the description preview.
In the front end I don't strip the tags, but that's another story.
I agree, all that is needed in the core is to add description to the query. Template overrides work fine for the view.
Being new to github I have no idea at all how this works or how to "submit a pull request". Been a lone wolf for too long, so will leave the suggestion for someone who knows how to do it. I'd be most grateful if someone could pick it up.
Thank you
RogerCO
If you've got the time, https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests should help out.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-11-12 21:50:48 |
Closed_By | ⇒ | Quy |
Closed_By | Quy | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/23056
If someone wants to submit a pull request adding the description to the query, that should get through without too much hassle.
But, I'd suggest that having descriptions on the list view is probably far too opinionated for core and better left to a template override.