Skip to content

Commit

Permalink
Add slug field to tag edit page
Browse files Browse the repository at this point in the history
Fixes #7
  • Loading branch information
Tam committed Apr 3, 2019
1 parent 5c9f487 commit 1f84a76
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [Unreleased] 1.0.2
### Added
- Added slug field to tag edit page

## 1.0.1 - 2018-09-27
### Fixed
- Fixed a bug when using Verbb's Control Panel Nav plugin
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ether/tags",
"description": "A tag manager for Craft 3",
"type": "craft-plugin",
"version": "1.0.1",
"version": "1.0.2",
"keywords": [
"craft",
"cms",
Expand Down
1 change: 1 addition & 0 deletions src/controllers/CpController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public function actionSave ()

// Populate
$tag->title = $request->getBodyParam('title', $tag->title);
$tag->slug = $request->getBodyParam('slug', $tag->slug);
$tag->setFieldValuesFromRequest(
$request->getParam('fieldsLocation', 'fields')
);
Expand Down
14 changes: 13 additions & 1 deletion src/templates/_edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,19 @@
{% endblock %}

{% block details %}
<div id="settings" class="meta"></div>
<div id="settings" class="meta">
{{ forms.textField({
label: 'Slug'|t('app'),
siteId: tag.siteId,
id: 'slug',
name: 'slug',
autocorrect: false,
autocapitalize: false,
value: tag.slug,
placeholder: 'Enter slug'|t('app'),
errors: (tag.getErrors('slug')|merge(tag.getErrors('uri')))
}) }}
</div>

{% if tag.id %}
<div class="meta read-only">
Expand Down

0 comments on commit 1f84a76

Please sign in to comment.