Commit e620bf16 authored by draconigen's avatar draconigen

added faq topic functionality

parent 6c8e21d7
......@@ -57,6 +57,7 @@ Router::scope('/', function (RouteBuilder $routes) {
*/
$routes->connect('/contact/:department', ['controller' => 'contact', 'action' => 'index'], ['pass' => ['department']]);
$routes->connect('/contact/:department/:template', ['controller' => 'contact', 'action' => 'index'], ['pass' => ['department', 'template']]);
$routes->connect('/faq/topic/:topic', ['controller' => 'faq', 'action' => 'index'], ['pass' => ['topic']]);
......
......@@ -45,8 +45,11 @@ class FaqController extends AppController
$this->Security->setConfig('unlockedActions', ['search']);
}
public function index() {
public function index($topic = null) {
if (isset($topic)) {
$this->set('autosearch', $topic);
}
$departmentsCtx = TableRegistry::get('Departments');
$articlesCtx = TableRegistry::get('Articles');
......
......@@ -262,3 +262,10 @@ echo '</ul>'; // #efhc-faqResults
}
</script>
<?php if (isset($autosearch)) : ?>
<script>
document.getElementById('search').value = '<?= $autosearch ?>';
prepareFaqSearch();
</script>
<?php endif; ?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment