joomla-extensions / weblinks

This repo is meant to hold the decoupled com_weblinks component and related code.
GNU General Public License v2.0
45 stars 88 forks source link

[4.0] param show_cat_num_links_cat or show_cat_num_links ? #463

Closed chmst closed 2 years ago

chmst commented 2 years ago

Steps to reproduce the issue

https://forum.joomla.de/thread/14353-com-weblinks-ist-f%C3%BCr-version-3-und-4-neu-freigegeben/?postID=93269#post93269

param for number of links is set but not displayed

Expected result

Number of links is shown in view categories

Actual result

Number is missing

System information (as much as possible)

https://forum.joomla.de/thread/14353-com-weblinks-ist-f%C3%BCr-version-3-und-4-neu-freigegeben/?postID=93269#post93269

Additional comments

joomdonation commented 2 years ago

Guess it causes by your copy/paste error while working on the layout. Could you please check and confirm this commit https://github.com/joomla-extensions/weblinks/commit/8aa92f906b7ea2740b245bbc999a6cf304528d0f fixed it?

chmst commented 2 years ago

https://github.com/joomla-extensions/weblinks/blob/master/src/administrator/components/com_weblinks/config.xml#L316 it was caused from here. The two models for category and categies use different filters. So we should decide which name we use everywhere.

joomdonation commented 2 years ago

The Categories model should use show_cat_num_links_cat parameter. The Category model will use show_cat_num_links parameter. That's same with how other core components work.

Sieger66 commented 2 years ago

Could you please check and confirm this commit 8aa92f9 fixed it?

I have check and for me it fix it for the weblinks-categories-view. Thank you.

In the weblinks-category-view is the same problem because at https://github.com/joomla-extensions/weblinks/blob/4.0-dev/src/components/com_weblinks/tmpl/category/default_children.php#L40

there is no code to display number of links as in joomla 3 Weblinks at:

https://github.com/joomla-extensions/weblinks/blob/3.9.0/src/components/com_weblinks/views/category/tmpl/default_children.php#L38-L43

My example:

<?php if ($this->params->get('show_cat_num_links') == 1) :?> <span class="weblink-count badge bg-info"> <?php echo JText::_('COM_WEBLINKS_NUM'); ?> <?php echo $child->numitems; ?> </span> <?php endif; ?>

or with other classes and html-tag.