Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
Ensure sections are dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbushnell committed Dec 15, 2020
1 parent 48d71ce commit 96da9e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ public function actionIndex()

// Display the template with the custom variables
return $this->renderTemplate('guide-module/index', [
"pluginName" => Config::getName(),
"pluginName" => Config::getName(),
"guideSection" => Config::getSection(),
"entry" => Entry::findOne([
'section' => 'userManual',
'section' => Config::getSection(),
'id' => Craft::$app->request->getSegment(2)
])
]);
Expand Down
2 changes: 1 addition & 1 deletion src/templates/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% block sidebar %}
<nav>
<ul>
{% nav page in craft.entries.section('userManual').all() %}
{% nav page in craft.entries.section(guideSection).all() %}
<li>
<a{% if entry is not null and entry.id == page.id %} class="sel"{% endif %} href="{{url('guide/' ~ page.id)}}">{{page.title}}</a>

Expand Down

0 comments on commit 96da9e0

Please sign in to comment.