This plugin allows you to create Banners to your
npm i @grupo-loja/banner-plugin
vendure-config.ts
: ...
plugins: [
BannerPlugin,
AdminUiPlugin.init({
port: 3002,
route: 'admin',
app: compileUiExtensions({
outputPath: path.join(__dirname, '__admin-ui'),
extensions: [BannerPlugin.ui],
}),
}),
...
]
...
banners
Create Banner
There are two ways to query your banners:
query Banners($options: BannerListOptions) {
banners(options: $options) {
items {
updatedAt
slug
id
items {
id
link
updatedAt
start
mobile {
Asset
}
end
createdAt
asset {
Asset
}
}
}
}
}
1: Filtering by slug
{
"options": {
"filter": {
"slug": {
"eq": "slug"
}
}
}
}
2: Filtering by id
{
"options": {
"filter": {
"id": {
"eq": "slug"
}
}
}
}
At the client side, do not forget to check for the end date whithin banner item to filter for expired banners.