Answer the question
In order to leave comments, you need to log in
How to set the format for url-addresses during the transition?
It was necessary to implement a block with links to search results pages on the page with the search filter. I did it, the question arose about the CNC: it is necessary that all links leading to the issuance of the filter have the form of the CNC, i.e. instead of
drupal-test/catalog/kabel?section_cable%5B%5D=2
drupal-test/catalog/kabel/section/2
hook_url_inbound_alter
like this:function semantic_search_url_inbound_alter(&$path, $original_path, $path_language) {
$parts = explode('/', $original_path);
if($parts[1] == 'kabel' && !empty($parts[2]))
{
if($parts[2] == 'razdel')
{
$_GET['razdel_cable[]'] = $parts[3];
$path = 'catalog/kabel';
}
elseif($parts[2] == 'type')
{
$_GET['type_of_cables[]'] = $parts[3];
$path = 'catalog/kabel';
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question