mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 23:36:08 -06:00
Merge pull request #320 from openclassify/dia
#74 Improvements of SEO link structure like Vebze (there was an error)
This commit is contained in:
commit
726723fc8e
@ -1,4 +1,8 @@
|
|||||||
|
{% set formHtml %}
|
||||||
|
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get">
|
||||||
|
{% endset %}
|
||||||
{% if 'cat' in param|keys %}
|
{% if 'cat' in param|keys %}
|
||||||
|
{% if not param['cat'] is empty %}
|
||||||
{% set catId = entries('cats', 'category').find(param['cat']) %}
|
{% set catId = entries('cats', 'category').find(param['cat']) %}
|
||||||
{% set cityId = null %}
|
{% set cityId = null %}
|
||||||
{% if 'city' in param|keys %}
|
{% if 'city' in param|keys %}
|
||||||
@ -7,10 +11,12 @@
|
|||||||
{% set cityId = entries('location', 'cities').find(param['city'][0]) %}
|
{% set cityId = entries('location', 'cities').find(param['city'][0]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% set formHtml %}
|
||||||
<form action="{{ url_route('adv_list_seo', [catId.slug, cityId.slug]) }}" method="get">
|
<form action="{{ url_route('adv_list_seo', [catId.slug, cityId.slug]) }}" method="get">
|
||||||
{% else %}
|
{% endset %}
|
||||||
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get">
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{{ formHtml }}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}">
|
<input type="hidden" name="cat" value="{{ app.request.get('cat') }}">
|
||||||
<input type="hidden" name="user" value="{{ app.request.get('user') }}">
|
<input type="hidden" name="user" value="{{ app.request.get('user') }}">
|
||||||
|
|||||||
@ -161,9 +161,17 @@ class AdvsController extends PublicController
|
|||||||
if ($categoryId) {
|
if ($categoryId) {
|
||||||
$param['cat'] = $categoryId->id;
|
$param['cat'] = $categoryId->id;
|
||||||
}
|
}
|
||||||
|
} elseif (isset($param['cat']) && !empty($param['cat'])) {
|
||||||
|
$categoryId = $this->category_repository->find($param['cat']);
|
||||||
|
return redirect($this->fullLink(
|
||||||
|
$param,
|
||||||
|
route('adv_list_seo', [$categoryId->slug]),
|
||||||
|
array()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search by city slug
|
// Search by city slug
|
||||||
|
if ($category) {
|
||||||
if (is_null($city) && isset($param['city'][0]) && !empty($param['city'][0]) && strpos($param['city'][0], ',') === false) {
|
if (is_null($city) && isset($param['city'][0]) && !empty($param['city'][0]) && strpos($param['city'][0], ',') === false) {
|
||||||
$cityId = $this->cityRepository->find($param['city'][0]);
|
$cityId = $this->cityRepository->find($param['city'][0]);
|
||||||
return redirect($this->fullLink(
|
return redirect($this->fullLink(
|
||||||
@ -173,7 +181,6 @@ class AdvsController extends PublicController
|
|||||||
));
|
));
|
||||||
} elseif (isset($param['city']) && !empty($param['city'][0]) && strpos($param['city'][0], ',') === false) {
|
} elseif (isset($param['city']) && !empty($param['city'][0]) && strpos($param['city'][0], ',') === false) {
|
||||||
$cityId = $this->cityRepository->find($param['city'][0]);
|
$cityId = $this->cityRepository->find($param['city'][0]);
|
||||||
$param['city'] = [$cityId->id];
|
|
||||||
if ($city !== $cityId->slug) {
|
if ($city !== $cityId->slug) {
|
||||||
return redirect($this->fullLink(
|
return redirect($this->fullLink(
|
||||||
$param,
|
$param,
|
||||||
@ -199,6 +206,8 @@ class AdvsController extends PublicController
|
|||||||
$param['city'] = [$cityId->id];
|
$param['city'] = [$cityId->id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$isActiveCustomFields = $this->adv_model->is_enabled('customfields');
|
$isActiveCustomFields = $this->adv_model->is_enabled('customfields');
|
||||||
$advs = $this->adv_repository->searchAdvs('list', $param, $customParameters);
|
$advs = $this->adv_repository->searchAdvs('list', $param, $customParameters);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user