-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit tag list #24
Comments
When I noticed you have the same problem I had, I thought I would got the chance to slightly contribute to this project and help the community. So here I am. |
Thanks. I will try this asap. The PR #25 only implements half of my request, but it's a good start. Still missing: the threshold. |
There are actually 2 possible scenarios to achieve this:
The latter is probably easier to achieve and makes is possible to use different limits (or none at all) in other places in the site. My assumption is, that adding code to a twig template that can (if needed) be called with parameters It would be nice if this is included in the plugin, but I guess this can also be done in a custom template. |
This is what I'm using currently {# Customized from taxonomylist plugin #}
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
{% set limit = 20 %} {# show only the first x items #}
{% set treshold = 3 %} {# at least this number of times used #}
{% if taxlist %}
<span class="tags">
{% set i = 0 %}
{% for tax,value in taxlist[taxonomy] if (((limit is not defined) or (i < limit)) and (treshold is not defined or (value >= treshold))) %}
{% set active = uri.param(taxonomy) == tax? 'active' : '' %}
<a class="{{ active }}" href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }} ({{ value }})</a>
{% set i = i + 1 %}
{% endfor %}
</span>
{% endif %} |
same issue here. For example here : https://www.intermezzo-coop.eu/fr/actualites/tag:Chandigarh Only 5 news are listed but it should be more ! Any help most welcome. Thanks |
I have a long list of tags, that is shown in the sidebar in full. Therefor I suggest the following features:
Limit number of tags
Add a config parameter
limit:
.Type is number.
Default is
0
.If limit is
0
all tags will be shown.The parameter specifies how many tags will be included from the top of the list, assuming that the list is sorted descending by the number of times a tag is used. Basically the 'top x' items.
Threshold for count
Add a config parameter
treshold:
.Type is number.
Default is
0
.If treshold is
0
or1
, then all tags will be shown.The parameter specifies how many times a tag should have been used before it appears in the list. If, for example, treshold is
3
, then only tags that are used at least 3 times will be shown.The text was updated successfully, but these errors were encountered: