Skip to content

Commit

Permalink
add terms variable to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kringkaste committed Sep 16, 2021
1 parent 2304abb commit a5c5b1e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Release Notes for Glossary for Craft CMS

## Unreleased
## 1.0.1 - 2021-09-16

### Added

- Added translation. Added German translation (thanks to @emsuiko).
- You can now iterate over terms in templates like `{{ for term in craft.glossary.terms.glossary('myGlossary').all() }}`.

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "codemonauts/craft-glossary",
"description": "A glossary for Craft CMS.",
"version": "1.0.0",
"description": "Add glossaries with tooltips to Craft CMS.",
"version": "1.0.1",
"type": "craft-plugin",
"keywords": [
"craft",
Expand Down Expand Up @@ -34,7 +34,7 @@
"handle": "glossary",
"class": "codemonauts\\glossary\\Glossary",
"name": "Glossary",
"description": "A glossary for Craft CMS.",
"description": "Add glossaries with tooltips to Craft CMS.",
"changelogUrl": "https://github.com/codemonauts/craft-glossary/blob/master/CHANGELOG.md",
"documentationUrl": "https://plugins.codemonauts.com/plugins/glossary/Introduction.html"
}
Expand Down
2 changes: 1 addition & 1 deletion src/Glossary.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Glossary extends Plugin
/**
* @inheritDoc
*/
public $schemaVersion = '1.0.0';
public $schemaVersion = '1.0.1';

/**
* @inheritDoc
Expand Down
6 changes: 6 additions & 0 deletions src/variables/GlossaryVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
namespace codemonauts\glossary\variables;

use codemonauts\glossary\elements\Glossary;
use codemonauts\glossary\elements\Term;

class GlossaryVariable
{
public function glossaries()
{
return Glossary::find();
}

public function terms()
{
return Term::find();
}
}

0 comments on commit a5c5b1e

Please sign in to comment.