mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#2599 ad count for sahibinden-base theme
This commit is contained in:
parent
3a5be3b62f
commit
9207609f01
@ -30,6 +30,7 @@ return [
|
||||
'default_published_time',
|
||||
'default_GET',
|
||||
'listing_page_image',
|
||||
'show_ads_count',
|
||||
],
|
||||
],
|
||||
'create_ad' => [
|
||||
|
||||
@ -325,4 +325,11 @@ return [
|
||||
'mode' => 'checkbox'
|
||||
],
|
||||
],
|
||||
'show_ads_count' => [
|
||||
'type' => 'anomaly.field_type.boolean',
|
||||
'config' => [
|
||||
'default_value' => true,
|
||||
'mode' => 'checkbox'
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
@ -197,4 +197,8 @@ return [
|
||||
'show_breadcrumb_when_creating_ad' => [
|
||||
'name' => 'Show Breadcrumb When Creating an Ad',
|
||||
],
|
||||
'show_ads_count' => [
|
||||
'name' => 'Show Ads Count',
|
||||
'instructions' => 'Show ads count on the left categories list',
|
||||
],
|
||||
];
|
||||
|
||||
@ -5,6 +5,12 @@
|
||||
<img src="{{ catIcon }}" alt="{{ main_category.name }}" class="img-responsive">
|
||||
<a href="{{ url_route('adv_list_seo', [main_category.slug]) }}" class="main-category">
|
||||
<b>{{ main_category.name }}</b>
|
||||
{% if setting_value('visiosoft.module.advs::show_ads_count') %}
|
||||
{% set catAdsCount = entries('advs', 'advs').countAdsByCategoryId(main_category.id) %}
|
||||
<small class="text-muted">
|
||||
({{ catAdsCount }})
|
||||
</small>
|
||||
{% endif %}
|
||||
</a>
|
||||
<ul class="p-0">
|
||||
{% set sub_categories = entries('cats','category').where('parent_category_id', main_category.id).where('deleted_at', null).orderBy('sort_order').get() %}
|
||||
@ -24,6 +30,13 @@
|
||||
{% for sub_category in sub_categories|slice(subLoop.start, subLoop.end) %}
|
||||
<li class="{{ subLoop.class }}">
|
||||
<a href="{{ url_route('adv_list_seo', [sub_category.slug]) }}">{{ sub_category.name }}</a>
|
||||
{% if setting_value('visiosoft.module.advs::show_ads_count') %}
|
||||
{% set catLevel = getParentsCount(sub_category.id) + 1 %}
|
||||
{% set catAdsCount = entries('advs', 'advs').countAdsByCategoryId(sub_category.id, catLevel) %}
|
||||
<small class="text-muted">
|
||||
({{ catAdsCount }})
|
||||
</small>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user