-
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
Limited tag list #25
base: develop
Are you sure you want to change the base?
Limited tag list #25
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
enabled: true | ||
route: '/blog' | ||
limit: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %} | ||
{% set limit = config.plugins.taxonomylist.limit %} | ||
|
||
{% if taxlist %} | ||
<span class="tags"> | ||
{% for tax,value in taxlist[taxonomy] %} | ||
{% set active = uri.param(taxonomy) == tax? 'active' : '' %} | ||
<a class="{{ active }}" href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }}</a> | ||
{% set count = 0 %} | ||
{% for tax,value in taxlist[taxonomy] if count < limit %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{% set label_class = uri.param(taxonomy) == tax ? 'label-primary' : 'label-secondary' %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also changes class names. Not only the logic. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't touch anything, just add a condition in the loop which refers to a variable in the taxonomy.yaml, because I noticed that the plugin already put the tags in order from the most used one to the less used ones. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, I forgot about my old modifications before posting the code. |
||
<a class="label label-rounded {{ label_class }}" title="{{ tax }}" href="{{ base_url_absolute }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }}</a> | ||
{% set count = count + 1 %} | ||
{% endfor %} | ||
</span> | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also does need this active state put back.