-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a768405
commit ef111f6
Showing
8 changed files
with
65 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.idea | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Read-only Field Changelog | ||
|
||
## 1.0.0 - 2019-04-06 | ||
### Added | ||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Read-only Field for Craft CMS 3.x | ||
|
||
![Icon](resources/readonly.png) | ||
|
||
A very simple read-only field type. | ||
|
||
## Background | ||
|
||
Sometimes you add content to Craft entries (for example via an API) that should be readable but not changeable for the user in the control panel. | ||
|
||
## Requirements | ||
|
||
* Craft CMS >= 3.0.0 | ||
|
||
## Installation | ||
|
||
Open your terminal and go to your Craft project: | ||
|
||
``` shell | ||
cd /path/to/project | ||
composer require codemonauts/craft-readonly-field | ||
``` | ||
|
||
In the control panel, go to Settings → Plugins and click the “install” button for *Read-only Field*. | ||
|
||
## Usage | ||
|
||
After installation, the control panel can be used to create fields that behave like plaintext fields, but can only be filled programmatically with content. In the control panel, the content is displayed but cannot be edited. | ||
|
||
With ❤ by [codemonauts](https://codemonauts.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,42 @@ | ||
{ | ||
"name": "codemonauts/craft-readonly-field", | ||
"description": "Craft 3 read-only plaintext field", | ||
"description": "Craft CMS plugin to add a simple, read-only plaintext field.", | ||
"version": "1.0.0", | ||
"type": "craft-plugin", | ||
"minimum-stability": "dev", | ||
"keywords": [ | ||
"craft", | ||
"cms", | ||
"craftcms", | ||
"craft-plugin" | ||
"craft-plugin", | ||
"field", | ||
"read-only" | ||
], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "codemonauts", | ||
"homepage": "https://codemonauts.com" | ||
} | ||
], | ||
"support": { | ||
"source": "https://github.com/codemonauts/craft-readonly-field", | ||
"docs": "https://github.com/codemonauts/craft-readonly-field/blob/master/README.md", | ||
"issues": "https://github.com/codemonauts/craft-readonly-field/issues" | ||
}, | ||
"license": "MIT", | ||
"require": { | ||
"craftcms/cms": "^3.0.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"codemonauts\\readonly\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Codemonauts", | ||
"homepage": "https://www.codemonauts.com" | ||
} | ||
], | ||
"require": { | ||
"craftcms/cms": "^3.0.0" | ||
}, | ||
"extra": { | ||
"handle": "readonly", | ||
"class": "codemonauts\\readonly\\Readonly", | ||
"name": "Read-only Field", | ||
"developer": "Codemonauts", | ||
"developerUrl": "https://www.codemonauts.com", | ||
"description": "Simple, read-only plaintext field.", | ||
"hasCpSection": false, | ||
"hasSettings": false, | ||
"class": "codemonauts\\readonly\\Readonly" | ||
"hasSettings": false | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
namespace codemonauts\readonly; | ||
|
||
use \craft\base\Plugin; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
<strong>{{ value }}</strong><input name="{{ name }}" type="hidden" value="{{ value }}" /> | ||
<strong>{{ value }}</strong> | ||
<input name="{{ name }}" type="hidden" value="{{ value }}" /> |