sylvainjule / kirby-imageradio Goto Github PK
View Code? Open in Web Editor NEWAdd illustrations to Kirby's radio buttons. Kirby 3 and 4.
Add illustrations to Kirby's radio buttons. Kirby 3 and 4.
I have a blueprint where I extend the (new in kirby 3.5) block type gallery like so:
projectgallery:
label: Gallery
type: blocks
fieldsets:
gallery:
extends: blocks/gallery
fields:
images:
max: 3
display:
label: Display
type: imageradio
columns: 4
ratio: 3/2
gap: true
fit: contain
options:
layout1:
text: Layout 1
image: layout1.svg
layout2:
text: Layout 2
image: layout2.svg
it looks fine in the backend:
but when I save, the display value doesnt get saved:
project.txt
----
Projectgallery: [{"content":{"images":["image_1.jpg"]},"id":"0ef7bf26-a46d-4465-b4fa-424c7f9928f3","isHidden":false,"type":"gallery"}]
----
Hey.
Thanks for this very helpful Plugin!
There seems to be a Problem with using it in Kirby Blocks. It simply gets not recognized as a radio field. In this case, I had to switch to the normal radio field.
Maybe you have an idea to fix this and make your plugin even more powerful.
I think a default
value is missing from the Kirby 3 version. Or am I doing something wrong?
beverage:
label: Beverage
type: imageradio
default: wine
options:
beer:
text: Beer
image: beer.jpg
wine:
text: Wine
image: wine.jpg
I think this is a really helpfull plugin, but when trying
text:
en: ...
de: ...
the text variable throws an error. am I doing something wrong? same for the checkbox plugin.
ERROR:
Undefined index: text in file: .../www/site/plugins/kirby-imageradio-master/lib/options/imageradio-options.php line: 69
line 69 would be:
'text' => $option['text'],
thanks in advance
Hello, I would like to use the plugin as an alternative tab in the layout settings. For this I would like to use the Kirby Field Conditional "when:".
Example:
Color-Palette Field
changeTab:
label: false
type: background-palette
columns: 2
options:
master:
background: 'var(--bs-c_1st) url(/assets/backend/img/icon_1.svg)'
tooltip: MASTER
2nd:
background: 'var(--bs-c_2nd) url(/assets/backend/img/icon_2.svg)'
tooltip: 2nd
default: master
width: 4/12
Condotional Field:
bgColor:
extends: fields/backgroundColor
label: Hintergrundfarbe ⇾ Layout
help: "Element: Layout (.layout)"
width: 1/2
when:
changeTab: 2nd
I adjusted the plugin a bit. My field type is called "background-palette". The color variable is now called Background in my adapted plug-in
It does not work to reference this field via another field (when :).
I need the value of the option (in the "value" array) in my Example "master"
The reason is probably the output as an array in the .txt file.
Is there a way to access the option or value via the condition field (when) within a blueprint?
Alternatively, I would like to change the plugin. Instead of an array, it should only store the "value" or option value. How can I solve this?
I apologize for my bad english. To be on the safe side, here is the text in German;)
Deutsch:
Hallo, ich würde das Plugin gerne als Tab Alternative in den Layout Einstellungen nutzen.
Hierzu möchte ich die Kirby Field Conditional "when:" nutzen.
Ich habe das Plugin etwas angepasst. Mein Feld-Typ heißt "background-palette". Die Variable Color heißt in meinem angepassten Plugin nun Background.
Es funktioniert nicht die dieses Feld über ein anderes Feld (when:) zu referenzieren. Ich benötige den Wert der Option (in Array "value") Bsp: master
Der Grund ist vermutlich die Ausgabe als Array in der .txt Datei.
Gibt es eine Möglichkeit auf den Wert -> value über die condition: when innerhalb eines blueprints zuzugreifen?Alternativ würde ich das Plugin gern entsprechend abändern. Statt einem Array soll es nur den "value" bzw. option Wert speichern. Wie kann ich dies lösen?
It would be great to have a K4 compatible version of this! :)
Option like a text: "Pic: {{ file.filename }} Size: {{ file.modified('d Y') }}"
— not work for me. I see only filename always 😕. Kirby 3.1.1
Hi,
is it possible to define a background for transparent images?
Cheers
Fatal error: Uncaught Error: Class 'Kirby' not found in .../vendor/sylvainjule/imageradio/config.php:3 Stack trace: #0 .../vendor/composer/autoload_real.php(66): require() #1 .../vendor/composer/autoload_real.php(56): composerRequiref500705cbefda5b7501a96695f683400('490010e42a89d95...', '/Users/tschneid...') #2 .../vendor/autoload.php(7): ComposerAutoloaderInitf500705cbefda5b7501a96695f683400::getLoader() #3 .../website/kirby/bootstrap.php(18): include('/Users/tschneid...') #4 .../website/index.php(3): require('/Users/tschneid...') #5 {main} thrown in .../vendor/sylvainjule/imageradio/config.php on line 3
Hi there,
Thx for your work Sylvain.
I install the plugin but the images aren't displayed.
Here is my blueprint :
space: type: imageradio fit: cover label: Position des blocs columns: 4 default: options: space\-between: text: Justifiés image: justi.jpg center: text: Groupés au centre image: center.jpg space\-evenly: text: Espacés uniformément image: uni.jpg space\-around: text: Marges additionnées image: add.jpg
Files are placed in the "assets" folder and named exactly the same as in the blueprint.
Any idea ?
Hi there!
I've just installed your plugin (which i think is pretty awesome i think :)) but when i put the folder renamed as imageradio in my plugins folder i get the next error:
"The imageradio field is missing. Please add it to your installed fields or remove it from your blueprint"
What am i doing wrong?
Thank you for your help!
Hi,
On a side note I have to say that I've been quite impressed by all your plugins so far(!)
So I'm having small issues with the imageradio field. It seems like it does not work when hidden (so either with using the newer 'when' field property or either with putting an imageradio field inside a 'kirby builder').
When doing so, I end up with an error:
'Undefined index: text' (when used with 'when:')
'Undefined offset: 3' (when used inside a 'kirby builder' field)
Has anybody reproduced this?
I wanted to use the imageradio as it's more explicit for grid layout choices :(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.