This is a plugin that allows you to generate QR Codes based on specific fields or generate QR Codes with Rest API.
This is a plugin that allows you to generate QR Codes based on specific fields or generate QR Codes with Rest API.
npm i strapi-plugin-qrcode-generator
or
yarn add strapi-plugin-qrcode-generator
Include this to your .env file :
1
STRAPI_BASE_FRONTEND=https://www.example.org
To display the download button and qr code, you need to edit or create config/plugins.js
, for each content type.
For example in the screenshot above, this is enabled :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module.exports = {
'qrcode-generator': {
enabled: true,
config: {
contentTypes: [
{
uid: 'api::cartel.cartel',
targetField: 'slug',
frontend: {
basePath: '/cartels',
},
},
],
},
},
};
Here we get cartel's field slug value, then we provide basePath's value inside frontend so that the downloaded qr code from the content manager includes it.
You can also get qr codes by querying qrcode-generator endpoint :
1
GET /qrcode-generator
Parameter | Description |
---|---|
download=true | Make it downloadable |
filename= | Filename of the file |
url= | Url to encode |
Example:
1
http://localhost:1337/qrcode-generator?url=www.example.org&filename=example-qrcode&download=true
npm install strapi-plugin-qrcode-generator
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.